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 Object implements FieldDecompositionSolver<T>
Specialized solver.
  • Field Details

    • 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 Details

    • 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 belong
      lu - entries of LU decomposition
      pivot - pivot permutation associated with LU decomposition
      singular - singularity indicator
  • Method Details

    • isNonSingular

      public boolean isNonSingular()
      Check if the decomposed matrix is non-singular.
      Specified by:
      isNonSingular in interface FieldDecompositionSolver<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 interface FieldDecompositionSolver<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 interface FieldDecompositionSolver<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 interface FieldDecompositionSolver<T extends FieldElement<T>>
      Returns:
      inverse matrix