Package org.ejml.data

Examples of org.ejml.data.D1Submatrix64F


            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);

            checkVector_row(rowB, end, offset, A, Bb, b);
        }
    }
View Full Code Here


            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);

            checkVector_row(rowB, end, offset, A, Bb, b);
        }
    }
View Full Code Here

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

            BlockVectorOps.add_row(r,
                    new D1Submatrix64F(Ab),rowA, alpha,
                    new D1Submatrix64F(Bb),rowB, beta ,
                    new D1Submatrix64F(Cb),rowC, offset,end);

            checkVector_row(rowC, end, offset, A, Cb, c);
        }
    }
View Full Code Here

            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);

            assertEquals(expected,found,1e-8);
        }
    }
View Full Code Here

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

            double expected = a.dot(b);

            double found = BlockVectorOps.dot_row_col(r,
                    new D1Submatrix64F(Ab),rowA,
                    new D1Submatrix64F(Bb),colB,
                    offset,end);

            assertEquals(expected,found,1e-8);
        }
    }
View Full Code Here

            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));

            // see if passing in the same matrix instance twice messes it up or not
            BlockTriangularSolver.invert(r,false,new D1Submatrix64F(T),new D1Submatrix64F(T),temp);

            assertTrue(BlockMatrixOps.isEquals(T,T_inv,1e-8));
        }
    }
View Full Code Here

            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);
View Full Code Here

            // Compute Y directly from the expected result B
            BlockMatrixOps.mult(T,B,Y);
        }

        // Y is overwritten with the solution
        BlockTriangularSolver.solve(r,upper,new D1Submatrix64F(T),new D1Submatrix64F(Y),transT);

        assertTrue( BlockMatrixOps.isEquals(B,Y,1e-8));
    }
View Full Code Here

        }

        int size = T.numRows;

        // Y is overwritten with the solution
        BlockTriangularSolver.solve(r,upper,new D1Submatrix64F(T2,0,size,0,size),new D1Submatrix64F(Y),transT);

        assertTrue( "Failed upper = "+upper+" transT = "+transT+" T.length "+T.numRows+" B.cols "+B.numCols,
                BlockMatrixOps.isEquals(B,Y,1e-8));
    }
View Full Code Here

        // do it again using block matrices
        BlockMatrix64F b_L = BlockMatrixOps.convert(L,3);
        BlockMatrix64F b_B = BlockMatrixOps.convert(B,3);

        D1Submatrix64F sub_L = new D1Submatrix64F(b_L,0, 3, 0, 3);
        D1Submatrix64F sub_B = new D1Submatrix64F(b_B,0, 3, 0, 5);

        if( transT ) {
            sub_L.original = BlockMatrixOps.transpose((BlockMatrix64F)sub_L.original,null);
            TestBlockMultiplication.transposeSub(sub_L);
        }
View Full Code Here

TOP

Related Classes of org.ejml.data.D1Submatrix64F

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.