org.apache.commons.math3.linear
Class FieldLUDecomposition.Solver<T extends FieldElement<T>>

java.lang.Object
  extended by org.apache.commons.math3.linear.FieldLUDecomposition.Solver<T>
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.


Field Summary
private  Field<T> field
          Field to which the elements belong.
private  T[][] lu
          Entries of LU decomposition.
private  int[] pivot
          Pivot permutation associated with LU decomposition.
private  boolean singular
          Singularity indicator.
 
Constructor Summary
private FieldLUDecomposition.Solver(Field<T> field, T[][] lu, int[] pivot, boolean singular)
          Build a solver from decomposed matrix.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

FieldLUDecomposition.Solver

private FieldLUDecomposition.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 Detail

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


Copyright (c) 2003-2013 Apache Software Foundation