Package org.ejml.data

Examples of org.ejml.data.D1Submatrix64F


        // extract a block aligned matrix
        int M = Math.min(QR.numRows,QR.numCols);

        BlockTriangularSolver.solve(QR.blockLength,true,
                new D1Submatrix64F(QR,0,M,0,M),new D1Submatrix64F(X),false);

    }
View Full Code Here


        // Solve using upper triangular R matrix
        // R*A^-1 = y
        // A^-1 = R^-1*y
        BlockTriangularSolver.solve(QR.blockLength,true,
                new D1Submatrix64F(QR,0,M,0,M),new D1Submatrix64F(A_inv),false);
    }
View Full Code Here

    @Override
    public void solve(BlockMatrix64F B, BlockMatrix64F X) {
        if( B.blockLength != blockLength )
            throw new IllegalArgumentException("Unexpected blocklength in B.");

        D1Submatrix64F L = new D1Submatrix64F(chol.getT(null));

        if( X != null ) {
            if( X.blockLength != blockLength )
                throw new IllegalArgumentException("Unexpected blocklength in X.");
            if( X.numRows != L.col1 ) throw new IllegalArgumentException("Not enough rows in X");
        }
       
        if( B.numRows != L.col1 ) throw new IllegalArgumentException("Not enough rows in B");

        //  L * L^T*X = B

        // Solve for Y:  L*Y = B
        BlockTriangularSolver.solve(blockLength,false,L,new D1Submatrix64F(B),false);

        // L^T * X = Y
        BlockTriangularSolver.solve(blockLength,false,L,new D1Submatrix64F(B),true);

        if( X != null ) {
            // copy the solution from B into X
            BlockMatrixOps.extractAligned(B,X);
        }
View Full Code Here

            temp = new double[ blockLength* blockLength ];

        // zero the upper triangular portion of A_inv
        BlockMatrixOps.zeroTriangle(true,A_inv);

        D1Submatrix64F L = new D1Submatrix64F(T);
        D1Submatrix64F B = new D1Submatrix64F(A_inv);

        // invert L from cholesky decomposition and write the solution into the lower
        // triangular portion of A_inv
        // B = inv(L)
        BlockTriangularSolver.invert(blockLength,false,L,B,temp);
View Full Code Here

        int h = A.row1-A.row0;

        // offset it to make the test harder
        // randomize to see if its set or adding
        BlockMatrix64F subC = BlockMatrixOps.createRandom(BLOCK_LENGTH +h, BLOCK_LENGTH +w, -1,1,rand, BLOCK_LENGTH);
        D1Submatrix64F C = new D1Submatrix64F(subC, BLOCK_LENGTH, subC.numRows, BLOCK_LENGTH, subC.numCols);

        DenseMatrix64F rmC = multByExtract(operationType,A,B,C);

        if( transA ) {
            origA = BlockMatrixOps.transpose(origA,null);
View Full Code Here

        A.col1 = A.row1;
        A.row1 = temp;
    }

    private static D1Submatrix64F sub( int row0 , int col0 , int row1 , int col1 ) {
        return new D1Submatrix64F(null,row0, row1, col0, col1);
    }
View Full Code Here

    @Test
    public void blockAligned() {
        int r = 3;
        BlockMatrix64F A = BlockMatrixOps.createRandom(10,11,-1,1,rand,r);

        D1Submatrix64F S = new D1Submatrix64F(A);

        assertTrue(BlockMatrixOps.blockAligned(r,S));

        S.row0 = r;
        S.col0 = 2*r;
 
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.