Package org.ejml.data

Examples of org.ejml.data.BlockD3Matrix64F


*/
public class BlockD3MatrixOps {

    public static BlockD3Matrix64F convert( DenseMatrix64F src , int blockLength )
    {
        BlockD3Matrix64F ret = new BlockD3Matrix64F(src.numRows,src.numCols,blockLength);

        convert(src,ret);

        return ret;
    }
View Full Code Here


        return ret;
    }

    public static BlockD3Matrix64F convert( DenseMatrix64F src )
    {
        BlockD3Matrix64F ret = new BlockD3Matrix64F(src.numRows,src.numCols);

        convert(src,ret);

        return ret;
    }
View Full Code Here

    public static BlockD3Matrix64F random( int numRows , int numCols ,
                                           double min , double max ,
                                           Random rand , int blockLength )
    {
        BlockD3Matrix64F ret = new BlockD3Matrix64F(numRows,numCols,blockLength);

        GenericMatrixOps.setRandom(ret,min,max,rand);

        return ret;
    }
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);
        BlockD3Matrix64F B = new BlockD3Matrix64F(A.numRows,A.numCols,BLOCK_LENGTH);

        BlockD3MatrixOps.convert(A,B);

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

        checkBlockToDense(20,20);
    }

    private void checkBlockToDense( int m , int n ) {
        DenseMatrix64F A = new DenseMatrix64F(m,n);
        BlockD3Matrix64F B = BlockD3MatrixOps.random(m,n,-1,1,rand,BLOCK_LENGTH);

        BlockD3MatrixOps.convert(B,A);

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

    private void checkMult(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);

        BlockD3Matrix64F A_b = BlockD3MatrixOps.convert(A_d,BLOCK_LENGTH);
        BlockD3Matrix64F B_b = BlockD3MatrixOps.convert(B_d,BLOCK_LENGTH);
        BlockD3Matrix64F C_b = BlockD3MatrixOps.random(m, o, -1 , 1 , rand , BLOCK_LENGTH);

        CommonOps.mult(A_d,B_d,C_d);
        BlockD3MatrixOps.mult(A_b,B_b,C_b);

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

        return curr-prev;
    }

    public static long multBlockD3Native( DenseMatrix64F matA , DenseMatrix64F matB ,
                                          DenseMatrix64F matResult , int numTrials) {
        BlockD3Matrix64F blockA = BlockD3MatrixOps.convert(matA);
        BlockD3Matrix64F blockB = BlockD3MatrixOps.convert(matB);
        BlockD3Matrix64F blockC = new BlockD3Matrix64F(matResult.numRows,matResult.numCols);

        long prev = System.currentTimeMillis();

        for( int i = 0; i < numTrials; i++ ) {
            BlockD3MatrixOps.mult(blockA,blockB,blockC);
View Full Code Here

TOP

Related Classes of org.ejml.data.BlockD3Matrix64F

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.