org.apache.commons.math3.linear

## Class LUDecomposition.Solver

- java.lang.Object
- - org.apache.commons.math3.linear.LUDecomposition.Solver

All Implemented Interfaces:
  DecompositionSolver

Enclosing class:
  LUDecomposition

    private static class LUDecomposition.Solver
    extends java.lang.Object
    implements DecompositionSolver

Specialized solver.

### Field Summary

Fields
`private double[][]` `lu` Entries of LU decomposition.
`private int[]` `pivot` Pivot permutation associated with LU decomposition.
`private boolean` `singular` Singularity indicator.

### Constructor Summary

Constructors
`private` `LUDecomposition.Solver(double[][] lu, int[] pivot, boolean singular)` Build a solver from decomposed matrix.

### Method Summary

Methods
`RealMatrix` `getInverse()` Get the inverse (or 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 for matrices A.
`RealVector` `solve(RealVector b)` Solve the linear equation A × X = B for matrices A.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### lu

    private final double[][] 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

#### LUDecomposition.Solver

    private LUDecomposition.Solver(double[][] lu,
                          int[] pivot,
                          boolean singular)

Build a solver from decomposed matrix.

Parameters:
  `lu` - entries of LU decomposition
  `pivot` - pivot permutation associated with LU decomposition
  `singular` - singularity indicator

### Method Detail

#### isNonSingular

    public boolean isNonSingular()

Check if the decomposed matrix is non-singular.

Specified by:
  `isNonSingular` in interface `DecompositionSolver`
Returns:
  true if the decomposed matrix is non-singular.

#### solve

    public RealVector solve(RealVector 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 `DecompositionSolver`
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 RealMatrix solve(RealMatrix 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 `DecompositionSolver`
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 RealMatrix getInverse()

Get the inverse (or pseudo-inverse) of the decomposed matrix.

Specified by:
  `getInverse` in interface `DecompositionSolver`
Returns:
  inverse matrix