Package mikera.matrixx

Examples of mikera.matrixx.Matrix.sub()


        checkComponents(alg,B);
    }

    public void testWide() {
        Matrix A = Matrix.createRandom(1,1);
        A.sub(0.5);
        A.scale(2);
        SvdImplicitQr alg = createSvd();
        assertNotNull(alg._decompose(A));

        checkComponents(alg,A);
View Full Code Here


        checkComponents(alg,A);
    }

    public void testTall() {
        Matrix A = Matrix.createRandom(21,5);
        A.sub(0.5);
        A.scale(2);

        SvdImplicitQr alg = createSvd();
        assertNotNull(alg._decompose(A));
View Full Code Here

     * See if it can handle very small values and not blow up.  This can some times
     * cause a zero to appear unexpectedly and thus a divided by zero.
     */
    public void testVerySmallValue() {
        Matrix A = Matrix.createRandom(5,5);
        A.sub(0.5);
        A.scale(2);

        A.scale(1e-200);

        SvdImplicitQr alg = createSvd();
View Full Code Here

        SvdImplicitQr alg = createSvd();

        for( int i = 1; i < 8; i+=2 ) {
            for( int j = 1; j < 8; j+=2 ) {
                Matrix A = Matrix.createRandom(i,j);
                A.sub(0.5);
                A.scale(2);

                assertNotNull(alg._decompose(A));

                checkComponents(alg,A);
View Full Code Here

    /**
     * Makes sure transposed flag is correctly handled.
     */
    public void checkGetU_Transpose() {
        Matrix A = Matrix.createRandom(5, 7);
        A.sub(0.5);
        A.scale(2);

        SvdImplicitQr alg = createSvd();
        assertNotNull(alg._decompose(A));

View Full Code Here

    public void testLargeToSmall() {
        SvdImplicitQr alg = createSvd();

        // first the larger one
        Matrix A = Matrix.createRandom(10,10);
        A.sub(0.5);
        A.scale(2);
        assertNotNull(alg._decompose(A));
        checkComponents(alg,A);

        // then the smaller one
View Full Code Here

        assertNotNull(alg._decompose(A));
        checkComponents(alg,A);

        // then the smaller one
        A = Matrix.createRandom(5,5);
        A.sub(0.5);
        A.scale(2);
       
        assertNotNull(alg._decompose(A));
        checkComponents(alg,A);
    }
View Full Code Here

//            System.out.println("N = "+N);

            for( int i = 0; i < 2; i++ ) {
                Matrix A = Matrix.createRandom(N,N);
                A.multiply(2);
                A.sub(1);
               
                assertNotNull(alg.decompose(A));

                performStandardTests(alg,A,-1);
            }
View Full Code Here

            if( Math.abs(c.y - 0) < 1e-8 ) {
                // test using the characteristic equation
                Matrix temp = Matrix.createIdentity(A.columnCount());
                temp.scale(c.x);
                temp.sub(a);
                double det = temp.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.
                assertEquals(0, det, 0.1);
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.