|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.vector.LUDecomposition<F>
public final class LUDecomposition<F extends Field<F>>
This class represents the decomposition of a matrix
A into a product of a lower
and upper triangular matrices, L
and U respectively, such as A = P·L·U with
P a permutation matrix.
This decomposition is typically used to resolve linear systems
of equations (Gaussian elimination) or to calculate the determinant
of a square Matrix (O(m³)).
Numerical stability is guaranteed through pivoting if the
Field elements are numbers
For others elements types, numerical stability can be ensured by setting
the context-local pivot
comparator (see setPivotComparator(java.util.Comparator).
Pivoting can be disabled by setting the pivot comparator to null (P
is then the matrix identity).
| Field Summary | |
|---|---|
static java.util.Comparator<Field> |
NUMERIC_COMPARATOR
Holds the default comparator for pivoting. |
| Method Summary | ||
|---|---|---|
F |
determinant()
Returns the determinant of the Matrix having this
decomposition. |
|
DenseMatrix<F> |
getLower(F zero,
F one)
Returns the lower matrix decomposition ( L) with diagonal
elements equal to the multiplicative identity for F. |
|
DenseMatrix<F> |
getLU()
Returns the lower/upper decomposition in one single matrix. |
|
SparseMatrix<F> |
getPermutation(F zero,
F one)
Returns the permutation matrix ( P). |
|
static java.util.Comparator<Field> |
getPivotComparator()
Returns the local
comparator used for pivoting or null if pivoting
is not performed (default NUMERIC_COMPARATOR). |
|
javolution.util.FastTable<javolution.util.Index> |
getPivots()
Returns the pivots elements of this decomposition. |
|
DenseMatrix<F> |
getUpper(F zero)
Returns the upper matrix decomposition ( U). |
|
DenseMatrix<F> |
inverse()
Returns the solution X of the equation: A * X = Identity with this = A.lu() using back and forward substitutions. |
|
static void |
setPivotComparator(java.util.Comparator<Field> cmp)
Sets the local comparator used
for pivoting or null to disable pivoting. |
|
DenseMatrix<F> |
solve(Matrix<F> B)
Returns the solution X of the equation: A * X = B with this = A.lu() using back and forward substitutions. |
|
static
|
valueOf(Matrix<F> source)
Returns the lower/upper decomposition of the specified matrix. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Comparator<Field> NUMERIC_COMPARATOR
| Method Detail |
|---|
public static <F extends Field<F>> LUDecomposition<F> valueOf(Matrix<F> source)
source - the matrix for which the decomposition is calculated.
DimensionException - if the specified matrix is not square.public static void setPivotComparator(java.util.Comparator<Field> cmp)
local comparator used
for pivoting or null to disable pivoting.
cmp - the comparator for pivoting or null.public static java.util.Comparator<Field> getPivotComparator()
local
comparator used for pivoting or null if pivoting
is not performed (default NUMERIC_COMPARATOR).
null.public DenseMatrix<F> solve(Matrix<F> B)
this = A.lu() using back and forward substitutions.
B - the input matrix.
DimensionException - if the dimensions do not match.public DenseMatrix<F> inverse()
this = A.lu() using back and forward substitutions.
this.solve(Identity)public F determinant()
Matrix having this
decomposition.
public DenseMatrix<F> getLower(F zero,
F one)
L) with diagonal
elements equal to the multiplicative identity for F.
zero - the additive identity for F.one - the multiplicative identity for F.
public DenseMatrix<F> getUpper(F zero)
U).
zero - the additive identity for F.
public SparseMatrix<F> getPermutation(F zero,
F one)
P).
zero - the additive identity for F.one - the multiplicative identity for F.
public DenseMatrix<F> getLU()
public javolution.util.FastTable<javolution.util.Index> getPivots()
|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||