Package org.ejml.data

Examples of org.ejml.data.Complex64F


        int N = alg.getNumberOfEigenvalues();

        SimpleMatrix a = SimpleMatrix.wrap(A);

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

            if( c.isReal() ) {
                // test using the characteristic equation
                double det = SimpleMatrix.identity(A.numCols).scale(c.real).minus(a).determinant();

                // extremely crude test.  given perfect data this is probably considered a failure...  However,
                // its hard to tell what a good test value actually is.
View Full Code Here


    {
        int N = alg.getNumberOfEigenvalues();

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

            if( Math.abs(c.real-valueReal) < 1e-4 && Math.abs(c.imaginary-valueImg) < 1e-4) {

                if( c.isReal() ) {
                    if( vector.length > 0 ) {
                        DenseMatrix64F v = alg.getEigenVector(i);
                        DenseMatrix64F e = new DenseMatrix64F(N,1, true, vector);

                        double error = SpecializedOps.diffNormF(e,v);
                        CommonOps.changeSign(e);
                        double error2 = SpecializedOps.diffNormF(e,v);


                        if(error < 1e-3 || error2 < 1e-3)
                            numMatched++;
                    } else {
                        numMatched++;
                    }
                } else if( !c.isReal() ) {
                    numMatched++;
                }
            }
        }
View Full Code Here

        if( eig.inputModified() )
            A = A.copy();
        eig.decompose(A);

        for( int i = 0; i < A.numRows; i++ ) {
            Complex64F v = eig.getEigenvalue(i);

            if( v.getReal() < 0 )
                return false;
        }

        return true;
    }
View Full Code Here

    {
        int N = alg.getNumberOfEigenvalues();

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

            if( Math.abs(c.real-valueReal) < 1e-4 && Math.abs(c.imaginary-valueImg) < 1e-4) {
                numFound++;
            }
        }
View Full Code Here

        int N = eig.getNumberOfEigenvalues();

        DenseMatrix64F D = new DenseMatrix64F( N , N );

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

            if( c.isReal() ) {
                D.set(i,i,c.real);
            }
        }

        return D;
View Full Code Here

        int N = eig.getNumberOfEigenvalues();

        DenseMatrix64F V = new DenseMatrix64F( N , N );

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

            if( c.isReal() ) {
                DenseMatrix64F v = eig.getEigenVector(i);

                if( v != null ) {
                    for( int j = 0; j < N; j++ ) {
                        V.set(j,i,v.get(j,0));
View Full Code Here

        for( int j = 0; j < extractor.getNumberOfEigenvalues(); j++ ) {
            if( ev[j].imaginary != 0 )
                continue;

            DenseMatrix64F v = EigenOps.computeEigenVector(a,ev[j].real).vector;
            Complex64F c = ev[j];

            if( v == null || MatrixFeatures.hasUncountable(v)) {
                a.print("%f");
                System.out.println("Can't find eigen vector?!?!");
                numCantFindEigenvector++;
                EigenOps.computeEigenVector(a,ev[j].real);
                continue;
            }

            double error = computeError(a,v,c.getReal());

            if( error > tol ) {
//                System.out.println("Failed on this matrix:");
//                a.print("%f");
                numFailed++;
View Full Code Here

        }

        assertEquals(5,extractor.getNumberOfEigenvalues());

        for( int i = 0 ; i < 5; i++ ) {
            Complex64F c = extractor.getEigenvalues()[i];

            assertEquals(0,c.imaginary,1e-12);
            assertEquals(0,c.getReal(),1e-12);
        }
    }
View Full Code Here

        }

        assertEquals(5,extractor.getNumberOfEigenvalues());

        for( int i = 0 ; i < 5; i++ ) {
            Complex64F c = extractor.getEigenvalues()[i];

            assertEquals(0,c.imaginary,1e-12);
            assertEquals(0,c.getReal(),1e-12);
        }
    }
View Full Code Here

            throw new RuntimeException("Failed!");
        }

        assertEquals(5,extractor.getNumberOfEigenvalues());
        for( int i = 0 ; i < 5; i++ ) {
            Complex64F c = extractor.getEigenvalues()[i];

            assertEquals(0,c.imaginary,1e-12);
            assertEquals(0,c.getReal(),1e-12);
        }
    }
View Full Code Here

TOP

Related Classes of org.ejml.data.Complex64F

Copyright © 2018 www.massapicom. 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.