/** * Creates a linear solver using LU decomposition */ public static LinearSolver<DenseMatrix64F> lu( int numRows ) { return linear(numRows); }
/** * Creates a general purpose solver. Use this if you are not sure what you need. * * @param numRows The number of rows that the decomposition is optimized for. * @param numCols The number of columns that the decomposition is optimized for. */ public static LinearSolver<DenseMatrix64F> general( int numRows , int numCols ) { if( numRows == numCols ) return linear(numRows); else return leastSquares(numRows,numCols); }
public HomographyInducedStereo3Pts() { // ensure that the inputs are not modified solver = new LinearSolverSafe<>(LinearSolverFactory.linear(3)); }
/** * Creates a general purpose solver. Use this if you are not sure what you need. * * @param numRows The number of rows that the decomposition is optimized for. * @param numCols The number of columns that the decomposition is optimized for. */ public static LinearSolver<DenseMatrix64F> general( int numRows , int numCols ) { if( numRows == numCols ) return linear(numRows); else return leastSquares(numRows,numCols); }
/** * Creates a general purpose solver. Use this if you are not sure what you need. * * @param numRows The number of rows that the decomposition is optimized for. * @param numCols The number of columns that the decomposition is optimized for. */ public static LinearSolver<DenseMatrix64F> general( int numRows , int numCols ) { if( numRows == numCols ) return linear(numRows); else return leastSquares(numRows,numCols); }
eigenvectorTemp = new DenseMatrix64F(N,1); solver = LinearSolverFactory.linear(0); } else {
eigenvectorTemp = new DenseMatrix64F(N,1); solver = LinearSolverFactory.linear(0); } else {
eigenvectorTemp = new DenseMatrix64F(N,1); solver = LinearSolverFactory.linear(0); } else {
/** * Computes the most dominant eigen vector of A using an inverted shifted matrix. * The inverted shifted matrix is defined as <b>B = (A - αI)<sup>-1</sup></b> and * can converge faster if α is chosen wisely. * * @param A An invertible square matrix matrix. * @param alpha Shifting factor. * @return If it converged or not. */ public boolean computeShiftInvert( DenseMatrix64F A , double alpha ) { initPower(A); LinearSolver solver = LinearSolverFactory.linear(A.numCols); SpecializedOps.addIdentity(A,B,-alpha); solver.setA(B); boolean converged = false; for( int i = 0; i < maxIterations && !converged; i++ ) { solver.solve(q0,q1); double s = NormOps.normPInf(q1); CommonOps.divide(s,q1,q2); converged = checkConverged(A); } return converged; }
/** * Computes the most dominant eigen vector of A using an inverted shifted matrix. * The inverted shifted matrix is defined as <b>B = (A - αI)<sup>-1</sup></b> and * can converge faster if α is chosen wisely. * * @param A An invertible square matrix matrix. * @param alpha Shifting factor. * @return If it converged or not. */ public boolean computeShiftInvert( DenseMatrix64F A , double alpha ) { initPower(A); LinearSolver solver = LinearSolverFactory.linear(A.numCols); SpecializedOps.addIdentity(A,B,-alpha); solver.setA(B); boolean converged = false; for( int i = 0; i < maxIterations && !converged; i++ ) { solver.solve(q0,q1); double s = NormOps.normPInf(q1); CommonOps.divide(q1,s,q2); converged = checkConverged(A); } return converged; }
solver = LinearSolverFactory.linear( lMatrix.numCols );
/** * Computes the most dominant eigen vector of A using an inverted shifted matrix. * The inverted shifted matrix is defined as <b>B = (A - αI)<sup>-1</sup></b> and * can converge faster if α is chosen wisely. * * @param A An invertible square matrix matrix. * @param alpha Shifting factor. * @return If it converged or not. */ public boolean computeShiftInvert( DenseMatrix64F A , double alpha ) { initPower(A); LinearSolver solver = LinearSolverFactory.linear(A.numCols); SpecializedOps.addIdentity(A,B,-alpha); solver.setA(B); boolean converged = false; for( int i = 0; i < maxIterations && !converged; i++ ) { solver.solve(q0,q1); double s = NormOps.normPInf(q1); CommonOps.divide(q1,s,q2); converged = checkConverged(A); } return converged; }
private void solveSystem(int numRows, int numCols) { LinearSolver<DenseMatrix64F> qrSolver = LinearSolverFactory.qr(numRows, numCols); QRDecomposition<DenseMatrix64F> decomposition = qrSolver.getDecomposition(); qrSolver.setA(X); y.setData(response); qrSolver.solve(this.y, this.b); DenseMatrix64F R = decomposition.getR(null, true); LinearSolver<DenseMatrix64F> linearSolver = LinearSolverFactory.linear(numCols); linearSolver.setA(R); DenseMatrix64F Rinverse = new DenseMatrix64F(numCols, numCols); linearSolver.invert(Rinverse); // stores solver's solution inside of Rinverse. CommonOps.multOuter(Rinverse, this.XtXInv); }
public MatrixExponentialCalculator(int size) { this.size = size; this.As = new DenseMatrix64F(size, size); this.As_2 = new DenseMatrix64F(size, size); this.As_4 = new DenseMatrix64F(size, size); this.As_6 = new DenseMatrix64F(size, size); this.U = new DenseMatrix64F(size, size); this.V = new DenseMatrix64F(size, size); this.AV = new DenseMatrix64F(size, size); this.N = new DenseMatrix64F(size, size); this.D = new DenseMatrix64F(size, size); this.temp = new DenseMatrix64F(size, size); solver = LinearSolverFactory.linear(size); }
public MatrixExponentialCalculator(int size) { this.size = size; this.As = new DenseMatrix64F(size, size); this.As_2 = new DenseMatrix64F(size, size); this.As_4 = new DenseMatrix64F(size, size); this.As_6 = new DenseMatrix64F(size, size); this.U = new DenseMatrix64F(size, size); this.V = new DenseMatrix64F(size, size); this.AV = new DenseMatrix64F(size, size); this.N = new DenseMatrix64F(size, size); this.D = new DenseMatrix64F(size, size); this.temp = new DenseMatrix64F(size, size); solver = LinearSolverFactory.linear(size); }
LinearSolver solver = LinearSolverFactory.linear(size); solver.setA(matrix); solver.invert(invMatrix);
Cblock = new DenseMatrix64F(pointsToInterpolate - 1, pointsToInterpolate + 2); A = new DenseMatrix64F(pointsToInterpolate + 2, pointsToInterpolate + 2); solver = LinearSolverFactory.linear(pointsToInterpolate + 2);
Cblock = new DenseMatrix64F(pointsToInterpolate - 1, pointsToInterpolate + 2); A = new DenseMatrix64F(pointsToInterpolate + 2, pointsToInterpolate + 2); solver = LinearSolverFactory.linear(pointsToInterpolate + 2);
FramePoint2D footstepLocationExpected = new FramePoint2D(); LinearSolver<DenseMatrix64F> simpleSolver = LinearSolverFactory.linear(6); DenseMatrix64F quadratic = new DenseMatrix64F(6, 6); DenseMatrix64F equals = new DenseMatrix64F(6, 1);
FramePoint2D footstepLocationExpected = new FramePoint2D(); LinearSolver<DenseMatrix64F> simpleSolver = LinearSolverFactory.linear(6); DenseMatrix64F quadratic = new DenseMatrix64F(6, 6); DenseMatrix64F equals = new DenseMatrix64F(6, 1);