Examples of AdjustableLinearSolver


Examples of org.ejml.alg.dense.linsol.AdjustableLinearSolver

    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.alg.dense.linsol.AdjustableLinearSolver

        DenseMatrix64F Y = new DenseMatrix64F(A_e.numRows,X.numCols);
        CommonOps.mult(A_e,X,Y);

        // create the solver from A then add a A.  The solver
        // should be equivalent to one created from A_e
        AdjustableLinearSolver adjSolver = new AdjLinearSolverQr();

        assertTrue(adjSolver.setA(A));
        adjSolver.addRowToA(row,insert);

        // solve the system and see if it gets the expected solution
        DenseMatrix64F X_found = RandomMatrices.createRandom(X.numRows,X.numCols,rand);
        adjSolver.solve(Y,X_found);

        // see if they produce the same results
        assertTrue(MatrixFeatures.isIdentical(X_found,X,1e-8));
    }
View Full Code Here

Examples of org.ejml.alg.dense.linsol.AdjustableLinearSolver

        DenseMatrix64F X = RandomMatrices.createRandom(n,2,rand);
        DenseMatrix64F Y = new DenseMatrix64F(A_e.numRows,X.numCols);
        CommonOps.mult(A_e,X,Y);

        // create the solver from the original system then modify it
        AdjustableLinearSolver adjSolver = new AdjLinearSolverQr();

        adjSolver.setA(A);
        adjSolver.removeRowFromA(remove);

        // see if it produces the epected results

        // solve the system and see if it gets the expected solution
        DenseMatrix64F X_found = RandomMatrices.createRandom(X.numRows,X.numCols,rand);
        adjSolver.solve(Y,X_found);

        // see if they produce the same results
        assertTrue(MatrixFeatures.isIdentical(X_found,X,1e-8));
    }
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.