Examples of DenseMatrix64F


Examples of org.ejml.data.DenseMatrix64F

    Random rand = new Random(234);

    @Test
    public void general() {
        DenseMatrix64F A = RandomMatrices.createRandom(5,4,rand);
        DenseMatrix64F x = RandomMatrices.createRandom(4,1,rand);
        DenseMatrix64F y = new DenseMatrix64F(5,1);

        LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.general(A.numRows, A.numCols);

        standardTest(A, x, y, solver);
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        standardTest(A, x, y, solver);
    }

    @Test
    public void linear() {
        DenseMatrix64F A = RandomMatrices.createRandom(4,4,rand);
        DenseMatrix64F x = RandomMatrices.createRandom(4,1,rand);
        DenseMatrix64F y = new DenseMatrix64F(4,1);

        LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.linear(A.numRows);

        standardTest(A, x, y, solver);
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        standardTest(A, x, y, solver);
    }

    @Test
    public void leastSquares() {
        DenseMatrix64F A = RandomMatrices.createRandom(5,4,rand);
        DenseMatrix64F x = RandomMatrices.createRandom(4,1,rand);
        DenseMatrix64F y = new DenseMatrix64F(5,1);

        LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.leastSquares(A.numRows,A.numCols);

        standardTest(A, x, y, solver);
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        standardTest(A, x, y, solver);
    }

    @Test
    public void symmetric() {
        DenseMatrix64F A = RandomMatrices.createSymmPosDef(5,rand);
        DenseMatrix64F x = RandomMatrices.createRandom(5,1,rand);
        DenseMatrix64F y = new DenseMatrix64F(5,1);

        LinearSolver<DenseMatrix64F> solver = LinearSolverFactory.symmPosDef(A.numCols);

        standardTest(A, x, y, solver);
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        standardTest(A, x, y, solver);
    }

    @Test
    public void adjustable() {
        DenseMatrix64F A = RandomMatrices.createRandom(5,4,rand);
        DenseMatrix64F x = RandomMatrices.createRandom(4,1,rand);
        DenseMatrix64F y = new DenseMatrix64F(5,1);

        AdjustableLinearSolver solver = LinearSolverFactory.adjustable();

        standardTest(A, x, y, solver);

        // remove the last observation
        solver.removeRowFromA(y.numRows-1);

        // compute the adjusted solution
        y.numRows--;
        DenseMatrix64F x_adj = new DenseMatrix64F(4,1);
        solver.solve(y,x_adj);

        // The solution should still be the same
        assertTrue(MatrixFeatures.isIdentical(x,x_adj,1e-8));
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

                              LinearSolver<DenseMatrix64F> solver) {
        solver = new LinearSolverSafe<DenseMatrix64F>(solver);

        CommonOps.mult(a,x,y);

        DenseMatrix64F x_found = new DenseMatrix64F(x.numRows,1);

        assertTrue(solver.setA(a));
        solver.solve(y,x_found);

        assertTrue(MatrixFeatures.isIdentical(x,x_found,1e-8));
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

     */
    @Test
    public void compareToLU() {

        for( int N = 2; N <= UnrolledInverseFromMinor.MAX; N++ ) {
            DenseMatrix64F A = RandomMatrices.createRandom(N,N,rand);

            DenseMatrix64F expected = new DenseMatrix64F(N,N);
            DenseMatrix64F found = new DenseMatrix64F(N,N);

            // first compute inverse by LU
            LUDecompositionAlt alg = new LUDecompositionAlt();
            LinearSolverLu solver = new LinearSolverLu(alg);

View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        if( !prefComputeU )
            throw new IllegalArgumentException("As requested U was not computed.");
        if( transpose )
            return Ut;

        U = new DenseMatrix64F(Ut.numCols,Ut.numRows);
        CommonOps.transpose(Ut,U);

        return U;
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

        if( !prefComputeV )
            throw new IllegalArgumentException("As requested V was not computed.");
        if( transpose )
            return Vt;

        V = new DenseMatrix64F(Vt.numCols,Vt.numRows);
        CommonOps.transpose(Vt,V);

        return V;
    }
View Full Code Here

Examples of org.ejml.data.DenseMatrix64F

    public DenseMatrix64F getW( DenseMatrix64F W ) {
        int m = compact ? numSingular : numRows;
        int n = compact ? numSingular : numCols;

        if( W == null )
            W = new DenseMatrix64F(m,n);
        else {
            W.reshape(m,n, false);
            W.zero();
        }
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.