Package org.apache.commons.math3.linear
Class FieldLUDecomposition.Solver<T extends FieldElement<T>>
- java.lang.Object
-
- org.apache.commons.math3.linear.FieldLUDecomposition.Solver<T>
-
- Type Parameters:
T
- the type of the field elements
- All Implemented Interfaces:
FieldDecompositionSolver<T>
- Enclosing class:
- FieldLUDecomposition<T extends FieldElement<T>>
private static class FieldLUDecomposition.Solver<T extends FieldElement<T>> extends java.lang.Object implements FieldDecompositionSolver<T>
Specialized solver.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldMatrix<T>
getInverse()
Get the inverse (or pseudo-inverse) of the decomposed matrix.boolean
isNonSingular()
Check if the decomposed matrix is non-singular.ArrayFieldVector<T>
solve(ArrayFieldVector<T> b)
Solve the linear equation A × X = B.FieldMatrix<T>
solve(FieldMatrix<T> b)
Solve the linear equation A × X = B for matrices A.FieldVector<T>
solve(FieldVector<T> b)
Solve the linear equation A × X = B for matrices A.
-
-
-
Field Detail
-
field
private final Field<T extends FieldElement<T>> field
Field to which the elements belong.
-
lu
private final T extends FieldElement<T>[][] lu
Entries of LU decomposition.
-
pivot
private final int[] pivot
Pivot permutation associated with LU decomposition.
-
singular
private final boolean singular
Singularity indicator.
-
-
Constructor Detail
-
Solver
private Solver(Field<T> field, T[][] lu, int[] pivot, boolean singular)
Build a solver from decomposed matrix.- Parameters:
field
- field to which the matrix elements belonglu
- entries of LU decompositionpivot
- pivot permutation associated with LU decompositionsingular
- singularity indicator
-
-
Method Detail
-
isNonSingular
public boolean isNonSingular()
Check if the decomposed matrix is non-singular.- Specified by:
isNonSingular
in interfaceFieldDecompositionSolver<T extends FieldElement<T>>
- Returns:
- true if the decomposed matrix is non-singular
-
solve
public FieldVector<T> solve(FieldVector<T> b)
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:
solve
in interfaceFieldDecompositionSolver<T extends FieldElement<T>>
- 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
public ArrayFieldVector<T> solve(ArrayFieldVector<T> b)
Solve the linear equation A × X = B.The A matrix is implicit here. It is
- Parameters:
b
- right-hand side of the equation A × X = B- Returns:
- a vector X such that A × X = B
- Throws:
DimensionMismatchException
- if the matrices dimensions do not match.SingularMatrixException
- if the decomposed matrix is singular.
-
solve
public FieldMatrix<T> solve(FieldMatrix<T> b)
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:
solve
in interfaceFieldDecompositionSolver<T extends FieldElement<T>>
- 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
public FieldMatrix<T> getInverse()
Get the inverse (or pseudo-inverse) of the decomposed matrix.- Specified by:
getInverse
in interfaceFieldDecompositionSolver<T extends FieldElement<T>>
- Returns:
- inverse matrix
-
-