Examples of BlockMatrix64F


Examples of org.ejml.data.BlockMatrix64F

//            System.out.println("width "+width);
            int end = width;
            int offset = width > 1 ? 1 : 0;

            SimpleMatrix A = SimpleMatrix.random(r,width,-1,1,rand);
            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Bb = Ab.copy();

            SimpleMatrix b = A.extractVector(true,rowA).scale(alpha);

            BlockVectorOps.scale_row(r,new D1Submatrix64F(Ab),rowA, alpha, new D1Submatrix64F(Bb),rowB,offset,end);
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

//            System.out.println("width "+width);
            int end = width;
            int offset = width > 1 ? 1 : 0;

            SimpleMatrix A = SimpleMatrix.random(r,width,-1,1,rand);
            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Bb = Ab.copy();

            SimpleMatrix b = A.extractVector(true,rowA).divide(alpha);

            BlockVectorOps.div_row(r,new D1Submatrix64F(Ab),rowA, alpha, new D1Submatrix64F(Bb),rowB,offset,end);
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

            int end = width;
            int offset = width > 1 ? 1 : 0;

            SimpleMatrix A = SimpleMatrix.random(r,width,-1,1,rand);
            SimpleMatrix B = SimpleMatrix.random(r,width,-1,1,rand);
            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Bb = BlockMatrixOps.convert(B.getMatrix(),r);
            BlockMatrix64F Cb = Ab.copy();

            SimpleMatrix a = A.extractVector(true,rowA).scale(alpha);
            SimpleMatrix b = B.extractVector(true,rowB).scale(beta);
            SimpleMatrix c = a.plus(b);
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

            SimpleMatrix A = SimpleMatrix.random(r,width,-1,1,rand);
            SimpleMatrix a = A.extractMatrix(rowA,rowA+1,offset,SimpleMatrix.END);
            SimpleMatrix B = SimpleMatrix.random(r,width,-1,1,rand);
            SimpleMatrix b = B.extractMatrix(rowB,rowB+1,offset,SimpleMatrix.END);

            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Bb = BlockMatrixOps.convert(B.getMatrix(),r);

            double expected = a.dot(b);

            double found = BlockVectorOps.dot_row(r,new D1Submatrix64F(Ab),rowA, new D1Submatrix64F(Bb),rowB,offset,end);
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

            SimpleMatrix A = SimpleMatrix.random(width,width,-1,1,rand);
            SimpleMatrix a = A.extractMatrix(rowA,rowA+1,offset,SimpleMatrix.END);
            SimpleMatrix B = SimpleMatrix.random(width,width,-1,1,rand);
            SimpleMatrix b = B.extractMatrix(offset,SimpleMatrix.END,colB,colB+1);

            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Bb = BlockMatrixOps.convert(B.getMatrix(),r);

            double expected = a.dot(b);

            double found = BlockVectorOps.dot_row_col(r,
                    new D1Submatrix64F(Ab),rowA,
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

        int r = 3;

        double temp[] = new double[r*r];

        for( int size = 1; size <= 9; size++ ) {
            BlockMatrix64F T = BlockMatrixOps.createRandom(size,size,-1,1,rand,r);
            BlockMatrixOps.zeroTriangle(true,T);

            BlockMatrix64F T_inv = T.copy();

            BlockTriangularSolver.invert(r,false,new D1Submatrix64F(T),new D1Submatrix64F(T_inv),temp);

            BlockMatrix64F C = new BlockMatrix64F(size,size,r);

            BlockMatrixOps.mult(T,T_inv,C);

            assertTrue(GenericMatrixOps.isIdentity(C,1e-8));

View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

        int r = 3;

        double temp[] = new double[r*r];

        for( int size = 1; size <= 9; size++ ) {
            BlockMatrix64F T = BlockMatrixOps.createRandom(size,size,-1,1,rand,r);
            BlockMatrixOps.zeroTriangle(true,T);

            BlockMatrix64F T_inv = T.copy();

            BlockTriangularSolver.invert(r,false,new D1Submatrix64F(T_inv),temp);

            BlockMatrix64F C = new BlockMatrix64F(size,size,r);

            BlockMatrixOps.mult(T,T_inv,C);

            assertTrue(GenericMatrixOps.isIdentity(C,1e-8));
        }
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

        for( int dir = 0; dir < 2; dir++ ) {
            boolean upper = dir == 0;
            for( int triangleSize = 1; triangleSize <= 9; triangleSize++ ) {
                for( int cols = 1; cols <= 9; cols++ ) {
//                System.out.println("triangle "+triangleSize+" cols "+cols);
                    BlockMatrix64F T = BlockMatrixOps.createRandom(triangleSize,triangleSize,-1,1,rand,r);
                    BlockMatrixOps.zeroTriangle(true,T);

                    if( upper ) {
                        T=BlockMatrixOps.transpose(T,null);
                    }

                    BlockMatrix64F B = BlockMatrixOps.createRandom(triangleSize,cols,-1,1,rand,r);
                    BlockMatrix64F Y = new BlockMatrix64F(B.numRows,B.numCols,r);

                    checkSolve(T,B,Y,r,upper,false);
                    checkSolve(T,B,Y,r,upper,true);

                    // test cases where the submatrix is not aligned with the inner
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

     */
    private void checkSolve( BlockMatrix64F T , BlockMatrix64F B , BlockMatrix64F Y ,
                             int r , boolean upper , boolean transT )
    {
        if( transT ) {
            BlockMatrix64F T_tran = BlockMatrixOps.transpose(T,null);

            // Compute Y directly from the expected result B
            BlockMatrixOps.mult(T_tran,B,Y);
        } else {
            // Compute Y directly from the expected result B
View Full Code Here

Examples of org.ejml.data.BlockMatrix64F

     * these inputs.  The solution is computed directly.
     */
    private void checkSolveUnaligned( BlockMatrix64F T , BlockMatrix64F B , BlockMatrix64F Y ,
                                      int r , boolean upper , boolean transT )
    {
        BlockMatrix64F T2;

        if( upper )
            T2 = BlockMatrixOps.createRandom(T.numRows+1,T.numCols,-1,1,rand,T.blockLength);
        else
            T2 = BlockMatrixOps.createRandom(T.numRows,T.numCols+1,-1,1,rand,T.blockLength);

        CommonOps.insert(T,T2,0,0);

        if( transT ) {
            BlockMatrix64F T_tran = BlockMatrixOps.transpose(T,null);

            // Compute Y directly from the expected result B
            BlockMatrixOps.mult(T_tran,B,Y);
        } else {
            // Compute Y directly from the expected result B
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.