public class SolvePseudoInverseSvd
extends java.lang.Object
implements org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>
The pseudo-inverse is typically used to solve over determined system for which there is no unique solution.
x=inv(ATA)ATb
where A ∈ ℜ m × n and m ≥ n.
This class implements the Moore-Penrose pseudo-inverse using SVD and should never fail. Alternative implementations can use Cholesky decomposition, but those will fail if the ATA matrix is singular. However the Cholesky implementation is much faster.
| Constructor and Description |
|---|
SolvePseudoInverseSvd()
Creates a solver targeted at matrices around 100x100
|
SolvePseudoInverseSvd(int maxRows,
int maxCols)
Creates a new solver targeted at the specified matrix size.
|
| Modifier and Type | Method and Description |
|---|---|
org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DenseMatrix64F> |
getDecomposer() |
org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DenseMatrix64F> |
getDecomposition() |
void |
invert(org.ejml.data.DenseMatrix64F A_inv) |
boolean |
modifiesA() |
boolean |
modifiesB() |
double |
quality() |
boolean |
setA(org.ejml.data.DenseMatrix64F A) |
void |
setThreshold(double threshold)
Specify the relative threshold used to select singular values.
|
void |
solve(org.ejml.data.DenseMatrix64F b,
org.ejml.data.DenseMatrix64F x) |
public SolvePseudoInverseSvd(int maxRows,
int maxCols)
maxRows - The expected largest matrix it might have to process. Can be larger.maxCols - The expected largest matrix it might have to process. Can be larger.public SolvePseudoInverseSvd()
public boolean setA(org.ejml.data.DenseMatrix64F A)
setA in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public double quality()
quality in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public void solve(org.ejml.data.DenseMatrix64F b,
org.ejml.data.DenseMatrix64F x)
solve in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public void invert(org.ejml.data.DenseMatrix64F A_inv)
invert in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public boolean modifiesA()
modifiesA in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public boolean modifiesB()
modifiesB in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DenseMatrix64F> getDecomposition()
getDecomposition in interface org.ejml.interfaces.linsol.LinearSolver<org.ejml.data.DenseMatrix64F>public void setThreshold(double threshold)
threshold - The singular value thresholdpublic org.ejml.interfaces.decomposition.SingularValueDecomposition<org.ejml.data.DenseMatrix64F> getDecomposer()