Examples of Eigenpair


Examples of org.ejml.data.Eigenpair

                if( error > 1e-12 ) {
                    System.out.println("Original matrix:");
                    A.print();
                    System.out.println("Eigenvalue = "+c.real);
                    Eigenpair p = EigenOps.computeEigenVector(A,c.real);
                    p.vector.print();
                    v.print();


                    CommonOps.mult(A,p.vector,tempA);
View Full Code Here

Examples of org.ejml.data.Eigenpair

        for( int i = 0; i < N; i++ ) {
            Complex64F c = alg.getEigenvalue(i);

            if( c.isReal() ) {
                Eigenpair p = EigenOps.computeEigenVector(A,c.getReal());

                if( p != null ) {
                    CommonOps.mult(A,p.vector,AV);
                    CommonOps.scale(c.getReal(),p.vector,LV);
                    double error = SpecializedOps.diffNormF(AV,LV);
View Full Code Here

Examples of org.ejml.data.Eigenpair

                    eigenvalue = origEigenvalue * Math.pow(val,i/2+1);
                    SpecializedOps.addIdentity(A,M,-eigenvalue);
                } else {
                    // otherwise assume that it was so accurate that the matrix was singular
                    // and return that result
                    return new Eigenpair(eigenvalue,b);
                }
            } else {
                hasWorked = true;
               
                b.set(x);
                NormOps.normalizeF(b);

                // compute the residual
                CommonOps.mult(M,b,x);
                double error = NormOps.normPInf(x);

                if( error-prevError > UtilEjml.EPS*10) {
                    // if the error increased it is probably converging towards a different
                    // eigenvalue
//                    CommonOps.set(b,1);
                    prevError = Double.MAX_VALUE;
                    hasWorked = false;
                    double val = i % 2 == 0 ? 1.0-perp : 1.0 + perp;
                    eigenvalue = origEigenvalue * Math.pow(val,1);
                } else {
                    // see if it has converged
                    if(error <= threshold || Math.abs(prevError-error) <= UtilEjml.EPS)
                        return new Eigenpair(eigenvalue,b);

                    // update everything
                    prevError = error;
                    eigenvalue = VectorVectorMult.innerProdA(b,A,b);
                }
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.