private static class SingularValueDecomposition.Solver extends java.lang.Object implements DecompositionSolver
Modifier and Type | Field and Description |
---|---|
private boolean |
nonSingular
Singularity indicator.
|
private RealMatrix |
pseudoInverse
Pseudo-inverse of the initial matrix.
|
Modifier | Constructor and Description |
---|---|
private |
SingularValueDecomposition.Solver(double[] singularValues,
RealMatrix uT,
RealMatrix v,
boolean nonSingular,
double tol)
Build a solver from decomposed matrix.
|
Modifier and Type | Method and Description |
---|---|
RealMatrix |
getInverse()
Get the pseudo-inverse of the decomposed matrix.
|
boolean |
isNonSingular()
Check if the decomposed matrix is non-singular.
|
RealMatrix |
solve(RealMatrix b)
Solve the linear equation A × X = B in least square sense.
|
RealVector |
solve(RealVector b)
Solve the linear equation A × X = B in least square sense.
|
private final RealMatrix pseudoInverse
private boolean nonSingular
private SingularValueDecomposition.Solver(double[] singularValues, RealMatrix uT, RealMatrix v, boolean nonSingular, double tol)
singularValues
- Singular values.uT
- UT matrix of the decomposition.v
- V matrix of the decomposition.nonSingular
- Singularity indicator.tol
- tolerance for singular valuespublic RealVector solve(RealVector b)
The m×n matrix A may not be square, the solution X is such that ||A × X - B|| is minimal.
solve
in interface DecompositionSolver
b
- Right-hand side of the equation A × X = BDimensionMismatchException
- if the matrices dimensions do not match.public RealMatrix solve(RealMatrix b)
The m×n matrix A may not be square, the solution X is such that ||A × X - B|| is minimal.
solve
in interface DecompositionSolver
b
- Right-hand side of the equation A × X = BDimensionMismatchException
- if the matrices dimensions do not match.public boolean isNonSingular()
isNonSingular
in interface DecompositionSolver
true
if the decomposed matrix is non-singular.public RealMatrix getInverse()
getInverse
in interface DecompositionSolver
Copyright (c) 2003-2013 Apache Software Foundation