Package mikera.vectorz

Examples of mikera.vectorz.Vector2


     * If the eigenvalues are all known, real, and the same this can be used to check them.
     */
    public void testEigenvalues( SymmetricQRAlgorithmDecomposition alg , double expected ) {

        for( int i = 0; i < alg.getNumberOfEigenvalues(); i++ ) {
            Vector2 c = alg.getEigenvalue(i);

            assertTrue(c.y==0);

            assertEquals(expected,c.x,1e-8);
        }
View Full Code Here


        // basic sanity tests
        assertEquals(A.rowCount(),alg.getNumberOfEigenvalues());

        if( numReal >= 0 ) {
            for( int i = 0; i < A.rowCount(); i++ ) {
                Vector2 v = alg.getEigenvalue(i);

                assertFalse( Double.isNaN(v.x ));
                if( v.y==0 )
                    numReal--;
                else if( Math.abs(v.y) < 10*EPS)
 
View Full Code Here

    {
//        System.out.println("-------------------------------------------------------------------------");
        int N = alg.getNumberOfEigenvalues();

        for( int i = 0; i < N; i++ ) {
            Vector2 c = alg.getEigenvalue(i);
            AVector v = alg.getEigenVector(i);

            if( Double.isInfinite(c.x) || Double.isNaN(c.x) ||
                    Double.isInfinite(c.y) || Double.isNaN(c.y))
                fail("Uncountable eigenvalue");
View Full Code Here

        int N = alg.getNumberOfEigenvalues();

        Matrix a = Matrix.create(A);

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

            if( Math.abs(c.y - 0) < 1e-8 ) {
                // test using the characteristic equation
                Matrix temp = Matrix.createIdentity(A.columnCount());
                temp.scale(c.x);
View Full Code Here

    {
        int N = alg.getNumberOfEigenvalues();

        int numMatched = 0;
        for( int i = 0; i < N; i++ ) {
            Vector2 c = alg.getEigenvalue(i);
           
            if( Math.abs(c.x-valueReal) < 1e-4 && Math.abs(c.y-valueImg) < 1e-4) {

//                if( c.isReal() ) {
                if(Math.abs(c.y - 0) < 1e-8)
View Full Code Here

                                   double valueImg , int numMatched ) {
        int N = alg.getNumberOfEigenvalues();

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

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

    public int getNumberOfEigenvalues() {
        return helper.getMatrixSize();
    }

    public Vector2 getEigenvalue(int index) {
        return new Vector2(values[index],0);
    }
View Full Code Here

    super.transform(source,dest);
  }
 
  public void transform(Vector2 source, AVector dest) {
    if (dest instanceof Vector2) {transform(source,(Vector2)dest); return;}
    Vector2 s=source;
    dest.set(0,(m00*s.x)+(m01*s.y));
    dest.set(1,(m10*s.x)+(m11*s.y));
  }
 
View Full Code Here

    dest.set(0,(m00*s.x)+(m01*s.y));
    dest.set(1,(m10*s.x)+(m11*s.y));
  }
 
  public void transform(Vector2 source, Vector2 dest) {
    Vector2 s=source;
    dest.x=((m00*s.x)+(m01*s.y));
    dest.y=((m10*s.x)+(m11*s.y));
  }
 
View Full Code Here

    dest.x=((m00*s.x)+(m01*s.y));
    dest.y=((m10*s.x)+(m11*s.y));
  }
 
  public Vector2 transform(Vector2 source) {
    Vector2 s=source;
    Vector2 result=new Vector2(
        ((m00*s.x)+(m01*s.y)),
        ((m10*s.x)+(m11*s.y)));
    return result;
  }
View Full Code Here

TOP

Related Classes of mikera.vectorz.Vector2

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.