public interface LinearSolverDense<T extends Matrix> extends LinearSolver<T,T>
An implementation of LinearSolverDense solves a linear system or inverts a matrix. It masks more complex
implementation details, while giving the programmer control over memory management and performance.
To quickly detect nearly singular matrices without computing the SVD the LinearSolver.quality()
function is provided.
A linear system is defined as:
A*X = B.
where A ∈ ℜ m × n, X ∈ ℜ n × p,
B ∈ ℜ m × p. Different implementations can solve different
types and shapes in input matrices and have different memory and runtime performance.
LinearSolver.setA(org.ejml.data.Matrix)
LinearSolver.solve(org.ejml.data.Matrix, org.ejml.data.Matrix)
.
To invert a matrix:
A matrix can also be inverted by passing in an identity matrix to solve, but this will be slower and more memory intensive than the specialized invert() function.
IMPORTANT: Depending upon the implementation, input matrices might be overwritten by
the solver. This
reduces memory and computational requirements and give more control to the programmer. If
the input matrices need to be not modified then LinearSolverSafe
can be used. The
functions LinearSolver.modifiesA()
and LinearSolver.modifiesB()
specify which input matrices are being
modified.
Modifier and Type | Method and Description |
---|---|
void |
invert(T A_inv)
Computes the inverse of of the 'A' matrix passed into
LinearSolver.setA(Matrix)
and writes the results to the provided matrix. |
getDecomposition, modifiesA, modifiesB, quality, setA, solve
void invert(T A_inv)
LinearSolver.setA(Matrix)
and writes the results to the provided matrix. If 'A_inv' needs to be different from 'A'
is implementation dependent.A_inv
- Where the inverted matrix saved. Modified.