Package org.ejml.data

Examples of org.ejml.data.BlockMatrix64F


        }
    }

    private void checkSize( int numRows , int numCols ) {
        DenseMatrix64F A = RandomMatrices.createRandom(numRows,numCols,-1,1,rand);
        BlockMatrix64F Ab = BlockMatrixOps.convert(A,r);

        QRDecompositionHouseholderTran algCheck = new QRDecompositionHouseholderTran();
        assertTrue(algCheck.decompose(A));

        assertTrue(alg.decompose(Ab));
View Full Code Here


            }
        }
    }

    private void checkFullDecomposition( int numRows , int numCols , boolean compact ) {
        BlockMatrix64F A = BlockMatrixOps.createRandom(numRows,numCols,-1,1,rand,r);

        assertTrue(alg.decompose(A.copy()));

        BlockMatrix64F Q = alg.getQ(null,compact);
        BlockMatrix64F R = alg.getR(null,compact);

        BlockMatrix64F found = new BlockMatrix64F(numRows,numCols,r);

        BlockMatrixOps.mult(Q,R,found);

        assertTrue(GenericMatrixOps.isEquivalent(A,found,1e-8));
    }
View Full Code Here

        checkConvert_dense_to_block(20,20);
    }

    private void checkConvert_dense_to_block( int m , int n ) {
        DenseMatrix64F A = RandomMatrices.createRandom(m,n,rand);
        BlockMatrix64F B = new BlockMatrix64F(A.numRows,A.numCols,BLOCK_LENGTH);

        BlockMatrixOps.convert(A,B);

        assertTrue( GenericMatrixOps.isEquivalent(A,B,1e-8));
    }
View Full Code Here

        double tmp[] = new double[BLOCK_LENGTH*n];
        DenseMatrix64F A = RandomMatrices.createRandom(m,n,rand);
        DenseMatrix64F A_orig = A.copy();

        BlockMatrixOps.convertRowToBlock(m,n,BLOCK_LENGTH,A.data,tmp);
        BlockMatrix64F B = BlockMatrix64F.wrap(A.data,A.numRows,A.numCols,BLOCK_LENGTH);

        assertTrue( GenericMatrixOps.isEquivalent(A_orig,B,1e-8));
    }
View Full Code Here

        checkBlockToDense(20,20);
    }

    private void checkBlockToDense( int m , int n ) {
        DenseMatrix64F A = new DenseMatrix64F(m,n);
        BlockMatrix64F B = BlockMatrixOps.createRandom(m,n,-1,1,rand);

        BlockMatrixOps.convert(B,A);

        assertTrue( GenericMatrixOps.isEquivalent(A,B,1e-8));
    }
View Full Code Here

        }
    }

    private void checkConvertInline_block_to_dense( int m , int n ) {
        double tmp[] = new double[BLOCK_LENGTH*n];
        BlockMatrix64F A = BlockMatrixOps.createRandom(m,n,-1,1,rand,BLOCK_LENGTH);
        BlockMatrix64F A_orig = A.copy();

        BlockMatrixOps.convertBlockToRow(m,n,BLOCK_LENGTH,A.data,tmp);
        DenseMatrix64F B = DenseMatrix64F.wrap(A.numRows,A.numCols,A.data);

        assertTrue( GenericMatrixOps.isEquivalent(A_orig,B,1e-8));
View Full Code Here

    /**
     * Makes sure exceptions are thrown for badly shaped input matrices.
     */
    private void checkMultInput( Method func, boolean transA , boolean transB ) {
        // bad block size
        BlockMatrix64F A = new BlockMatrix64F(5,4,3);
        BlockMatrix64F B = new BlockMatrix64F(4,6,3);
        BlockMatrix64F C = new BlockMatrix64F(5,6,4);

        invokeErrorCheck(func, transA , transB , A, B, C);
        C.blockLength = 3;
        B.blockLength = 4;
        invokeErrorCheck(func, transA , transB ,A, B, C);
View Full Code Here

                            int m, int n, int o) {
        DenseMatrix64F A_d = RandomMatrices.createRandom(m, n,rand);
        DenseMatrix64F B_d = RandomMatrices.createRandom(n, o,rand);
        DenseMatrix64F C_d = new DenseMatrix64F(m, o);

        BlockMatrix64F A_b = BlockMatrixOps.convert(A_d,BLOCK_LENGTH);
        BlockMatrix64F B_b = BlockMatrixOps.convert(B_d,BLOCK_LENGTH);
        BlockMatrix64F C_b = BlockMatrixOps.createRandom(m, o, -1 , 1 , rand , BLOCK_LENGTH);

        if( transA )
            A_b=BlockMatrixOps.transpose(A_b,null);

        if( transB )
View Full Code Here

    }

    private void checkTranSrcBlockToDense( int m , int n ) {
        DenseMatrix64F A = RandomMatrices.createRandom(m,n,rand);
        DenseMatrix64F A_t = new DenseMatrix64F(n,m);
        BlockMatrix64F B = new BlockMatrix64F(n,m,BLOCK_LENGTH);

        CommonOps.transpose(A,A_t);
        BlockMatrixOps.convertTranSrc(A,B);

        assertTrue( GenericMatrixOps.isEquivalent(A_t,B,1e-8));
View Full Code Here

    private void checkTranspose( int m , int n ) {
        DenseMatrix64F A = RandomMatrices.createRandom(m,n,rand);
        DenseMatrix64F A_t = new DenseMatrix64F(n,m);

        BlockMatrix64F B = new BlockMatrix64F(A.numRows,A.numCols,BLOCK_LENGTH);
        BlockMatrix64F B_t = new BlockMatrix64F(n,m,BLOCK_LENGTH);

        BlockMatrixOps.convert(A,B);

        CommonOps.transpose(A,A_t);
        BlockMatrixOps.transpose(B,B_t);
View Full Code Here

TOP

Related Classes of org.ejml.data.BlockMatrix64F

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.