Package org.ejml.data

Examples of org.ejml.data.D1Submatrix64F


        SimpleMatrix expected = A.minus( A.mult(U).mult(U.transpose()).scale(gamma) );

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

        BlockHouseHolder.rank1UpdateMultL_LeftCol(r,new D1Submatrix64F(Ab),row,gamma,zeroOffset);

        for( int i = r; i < A.numRows(); i++ ) {
            for( int j = 0; j < r; j++ ) {
                assertEquals(expected.get(i,j),Ab.get(i,j),1e-8);
            }
View Full Code Here


                SimpleMatrix A = SimpleMatrix.random(2*r+2,2*r+2,-1,1,rand);
                A = A.mult(A.transpose());
                SimpleMatrix A_orig = A.copy();
                SimpleMatrix V = SimpleMatrix.random(r,A.numCols(),-1,1,rand);

                D1Submatrix64F Ab = insertIntoBlock(offY,offX,A,r);
                D1Submatrix64F Vb = insertIntoBlock(0,offX,V,r);

                int row = r-1;

                // manually apply "reflectors" to A
                for( int i = 0; i < row; i++ ) {
View Full Code Here

            }
            v0.set(innerCol,1.0);

            double expected = VectorVectorMult.innerProd(v0,v1);

            D1Submatrix64F subAb = new D1Submatrix64F(Ab,row,A.numRows,colBlock,A.numCols);

            double found = BlockHouseHolder.innerProdCol(r,subAb,colA-colBlock,widthA,colB-colBlock,widthB);

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

            }
            v0.set(rowA+zeroOffset,1.0);

            double expected = VectorVectorMult.innerProd(v0,v1);

            D1Submatrix64F subAb = new D1Submatrix64F(Ab,rowBlock,A.numRows,0,A.numCols);

            double found = BlockHouseHolder.innerProdRow(r, subAb,rowA,subAb,rowB,zeroOffset);

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

    {
        DenseMatrix64F B = new DenseMatrix64F(offRow+A.numRows(),offCol+A.numCols());
        CommonOps.insert(A.getMatrix(),B,offRow,offCol);

        BlockMatrix64F C = BlockMatrixOps.convert(B,r);
        return new D1Submatrix64F(C,offRow,C.numRows,offCol,C.numCols);
    }
View Full Code Here

        double div = 1.5;
        int col = 1;
        BlockMatrix64F A = BlockMatrixOps.createRandom(r*2+r-1,r,-1,1,rand,r);
        BlockMatrix64F A_orig = A.copy();

        BlockHouseHolder.divideElementsCol(r,new D1Submatrix64F(A),col,div);

        for( int i = col+1; i < A.numRows; i++ ) {
            assertEquals(A_orig.get(i,col)/div , A.get(i,col),1e-8);
        }
    }
View Full Code Here

        }
        u.set(row+1,1);

        SimpleMatrix v = A.mult(u).transpose();

        TridiagonalBlockHelper.multA_u(r,new D1Submatrix64F(Ab),
                new D1Submatrix64F(V),row);

        for( int i = row+1; i < A.numCols(); i++ ) {
            assertEquals(v.get(i),V.get(row,i),1e-8);
        }
    }
View Full Code Here

        double div = 1.5;
        int row = 1;
        BlockMatrix64F A = BlockMatrixOps.createRandom(r*2+r-1,r*2+1,-1,1,rand,r);
        BlockMatrix64F A_orig = A.copy();

        BlockHouseHolder.scale_row(r,new D1Submatrix64F(A),new D1Submatrix64F(A),row,1,div);

        // check the one
        assertEquals(div,A.get(row,row+1),1e-8);
        // check the rest
        for( int i = row+2; i < A.numCols; i++ ) {
View Full Code Here

            y = y.scale(-gamma);

            BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
            BlockMatrix64F Vb = BlockMatrixOps.convert(Vo.getMatrix(),r);

            TridiagonalBlockHelper.computeY(r,new D1Submatrix64F(Ab),new D1Submatrix64F(Vb),row,gamma);

            for( int i = row+1; i < A.numCols(); i++ ) {
                assertEquals(Vb.get(row,i),y.get(i),1e-8);
            }
        }
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);

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

            // skip over the zeros
            for( int j = rowA+1; j < end; j++ ) {
                assertEquals(c.get(j), Cb.get(rowC,j),1e-8);
            }
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.