Class LUDecomposition.Solver
java.lang.Object
org.apache.commons.math3.linear.LUDecomposition.Solver
- All Implemented Interfaces:
DecompositionSolver
- Enclosing class:
LUDecomposition
Specialized solver.
- Since:
- 2.0 (changed to concrete class in 3.0)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSolver(double[][] lu, int[] pivot, boolean singular) Build a solver from decomposed matrix. -
Method Summary
Modifier and TypeMethodDescriptionGet the inverse of the decomposed matrix.booleanCheck if the decomposed matrix is non-singular.solve(RealMatrix b) Solve the linear equation A × X = B for matrices A.solve(RealVector b) Solve the linear equation A × X = B for matrices A.
-
Field Details
-
lu
private final double[][] luEntries of LU decomposition. -
pivot
private final int[] pivotPivot permutation associated with LU decomposition. -
singular
private final boolean singularSingularity indicator.
-
-
Constructor Details
-
Solver
private Solver(double[][] lu, int[] pivot, boolean singular) Build a solver from decomposed matrix.- Parameters:
lu- entries of LU decompositionpivot- pivot permutation associated with LU decompositionsingular- singularity indicator
-
-
Method Details
-
isNonSingular
public boolean isNonSingular()Check if the decomposed matrix is non-singular.- Specified by:
isNonSingularin interfaceDecompositionSolver- Returns:
- true if the decomposed matrix is non-singular.
-
solve
Solve the linear equation A × X = B for matrices A.The A matrix is implicit, it is provided by the underlying decomposition algorithm.
- Specified by:
solvein interfaceDecompositionSolver- Parameters:
b- right-hand side of the equation A × X = B- Returns:
- a vector X that minimizes the two norm of A × X - B
-
solve
Solve the linear equation A × X = B for matrices A.The A matrix is implicit, it is provided by the underlying decomposition algorithm.
- Specified by:
solvein interfaceDecompositionSolver- Parameters:
b- right-hand side of the equation A × X = B- Returns:
- a matrix X that minimizes the two norm of A × X - B
-
getInverse
Get the inverse of the decomposed matrix.- Specified by:
getInversein interfaceDecompositionSolver- Returns:
- the inverse matrix.
- Throws:
SingularMatrixException- if the decomposed matrix is singular.
-