org.apache.commons.math.linear
Class FieldLUDecompositionImpl.Solver<T extends FieldElement<T>>

java.lang.Object
  extended by org.apache.commons.math.linear.FieldLUDecompositionImpl.Solver<T>
All Implemented Interfaces:
FieldDecompositionSolver<T>
Enclosing class:
FieldLUDecompositionImpl<T extends FieldElement<T>>

private static class FieldLUDecompositionImpl.Solver<T extends FieldElement<T>>
extends 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 static long serialVersionUID
          Serializable version identifier.
private  boolean singular
          Singularity indicator.
 
Constructor Summary
private FieldLUDecompositionImpl.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.
 T[] solve(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

serialVersionUID

private static final long serialVersionUID
Serializable version identifier.

See Also:
Constant Field Values

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

FieldLUDecompositionImpl.Solver

private FieldLUDecompositionImpl.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 T[] solve(T[] b)
                                  throws IllegalArgumentException,
                                         InvalidMatrixException
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
Throws:
IllegalArgumentException - if matrices dimensions don't match
InvalidMatrixException - if decomposed matrix is singular

solve

public FieldVector<T> solve(FieldVector<T> b)
                                             throws IllegalArgumentException,
                                                    InvalidMatrixException
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
Throws:
IllegalArgumentException - if matrices dimensions don't match
InvalidMatrixException - if decomposed matrix is singular

solve

public ArrayFieldVector<T> solve(ArrayFieldVector<T> b)
                                                  throws IllegalArgumentException,
                                                         InvalidMatrixException
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:
IllegalArgumentException - if matrices dimensions don't match
InvalidMatrixException - if decomposed matrix is singular

solve

public FieldMatrix<T> solve(FieldMatrix<T> b)
                                             throws IllegalArgumentException,
                                                    InvalidMatrixException
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
Throws:
IllegalArgumentException - if matrices dimensions don't match
InvalidMatrixException - if decomposed matrix is singular

getInverse

public FieldMatrix<T> getInverse()
                                                  throws InvalidMatrixException
Get the inverse (or pseudo-inverse) of the decomposed matrix.

Specified by:
getInverse in interface FieldDecompositionSolver<T extends FieldElement<T>>
Returns:
inverse matrix
Throws:
InvalidMatrixException - if decomposed matrix is singular


Copyright (c) 2003-2013 Apache Software Foundation