public class LinearSolverFactory_FDRM
extends java.lang.Object
Constructor and Description |
---|
LinearSolverFactory_FDRM() |
Modifier and Type | Method and Description |
---|---|
static AdjustableLinearSolver_FDRM |
adjustable()
Create a solver which can efficiently add and remove elements instead of recomputing
everything from scratch.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
chol(int numRows)
Creates a linear solver using Cholesky decomposition
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
general(int numRows,
int numCols)
Creates a general purpose solver.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
leastSquares(int numRows,
int numCols)
Creates a good general purpose solver for over determined systems and returns the optimal least-squares
solution.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
leastSquaresQrPivot(boolean computeNorm2,
boolean computeQ)
Linear solver which uses QR pivot decomposition.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
linear(int matrixSize)
Creates a solver for linear systems.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
lu(int numRows)
Creates a linear solver using LU decomposition
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
pseudoInverse(boolean useSVD)
Returns a solver which uses the pseudo inverse.
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
qr(int numRows,
int numCols)
Creates a linear solver using QR decomposition
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
qrp(boolean computeNorm2,
boolean computeQ)
Creates a linear solver using QRP decomposition
|
static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> |
symmPosDef(int matrixWidth)
Creates a solver for symmetric positive definite matrices.
|
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> lu(int numRows)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> chol(int numRows)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> qr(int numRows, int numCols)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> qrp(boolean computeNorm2, boolean computeQ)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> general(int numRows, int numCols)
numRows
- The number of rows that the decomposition is optimized for.numCols
- The number of columns that the decomposition is optimized for.public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> linear(int matrixSize)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> leastSquares(int numRows, int numCols)
numRows
- The number of rows that the decomposition is optimized for.numCols
- The number of columns that the decomposition is optimized for.public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> symmPosDef(int matrixWidth)
public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> leastSquaresQrPivot(boolean computeNorm2, boolean computeQ)
Linear solver which uses QR pivot decomposition. These solvers can handle singular systems and should never fail. For singular systems, the solution might not be as accurate as a pseudo inverse that uses SVD.
For singular systems there are multiple correct solutions. The optimal 2-norm solution is the
solution vector with the minimal 2-norm and is unique. If the optimal solution is not computed
then the basic solution is returned. See BaseLinearSolverQrp_FDRM
for details. There is only a runtime difference for small matrices, 2-norm solution is slower.
Two different solvers are available. Compute Q will compute the Q matrix once then use it multiple times. If the solution for a single vector is being found then this should be set to false. If the pseudo inverse is being found or the solution matrix has more than one columns AND solve is being called numerous multiples times then this should be set to true.
computeNorm2
- true to compute the minimum 2-norm solution for singular systems. Try true.computeQ
- Should it precompute Q or use house holder. Try false;public static org.ejml.interfaces.linsol.LinearSolverDense<org.ejml.data.FMatrixRMaj> pseudoInverse(boolean useSVD)
Returns a solver which uses the pseudo inverse. Useful when a matrix needs to be inverted which is singular. Two variants of pseudo inverse are provided. SVD will tend to be the most robust but the slowest and QR decomposition with column pivots will be faster, but less robust.
See leastSquaresQrPivot(boolean, boolean)
for additional options specific to QR decomposition based
pseudo inverse. These options allow for better runtime performance in different situations.
useSVD
- If true SVD will be used, otherwise QR with column pivot will be used.public static AdjustableLinearSolver_FDRM adjustable()