Package javax.vecmath

Examples of javax.vecmath.GVector.mul()


    public static GVector conjugateGradientSolve( GMatrix matrix, GVector b,
                                                  GVector initialGuess, double eps ) {

        GVector x = new GVector( initialGuess );
        GVector tempv = new GVector( initialGuess );
        tempv.mul( matrix, initialGuess );
        GVector bb = new GVector( b );
        bb.sub( tempv );
        GVector r = new GVector( bb );
        GVector p = new GVector( r );
        GVector xnew = new GVector( p );
View Full Code Here


        matrixInverse.invert();
        double error, norm;
        int iteration = 0;

        do {
            matrixMultp.mul( matrix, p );
            double lambda = (r.dot( p ) / p.dot( matrixMultp ));
            xnew.scaleAdd( lambda, p, x );
            rnew.scaleAdd( -lambda, matrixMultp, r );
            double alpha = -(rnew.dot( matrixMultp ) / p.dot( matrixMultp));
            pnew.scaleAdd( alpha, p, rnew );
View Full Code Here

            k.setElement(i, i, kElem - lambda);
        }
       
        k.invert();
        GVector c = new GVector(numPoints);
        c.mul(k, values);
       
        return new Representer(kernel, data, c);
    }
   
    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.