## Class FieldLUDecomposition<T>

• java.lang.Object
• org.apache.commons.math4.legacy.field.linalg.FieldLUDecomposition<T>
• Type Parameters:
T - Type of the field elements.

public final class FieldLUDecomposition<T>
extends Object
Calculates the LUP-decomposition of a square matrix.

The LUP-decomposition of a matrix A consists of three matrices L, U and P that satisfy: PA = LU, L is lower triangular, and U is upper triangular and P is a permutation matrix. All matrices are m×m.

Since field elements do not provide an ordering operator, the permutation matrix is computed here only in order to avoid a zero pivot element, no attempt is done to get the largest pivot element.

Since:
4.0
MathWorld, Wikipedia
• ### Method Summary

All Methods
Modifier and Type Method Description
T getDeterminant()
Return the determinant of the matrix.
FieldDenseMatrix<T> getL()
Builds the "L" matrix of the decomposition.
FieldDenseMatrix<T> getP()
Builds the "P" matrix.
int[] getPivot()
Gets the pivot permutation vector.
FieldDecompositionSolver<T> getSolver()
Creates a solver for finding the solution X of the linear system of equations A X = B.
FieldDenseMatrix<T> getU()
Builds the "U" matrix of the decomposition.
boolean isSingular()
static <T> FieldLUDecomposition<T> of​(FieldDenseMatrix<T> m)
Factory method.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Method Detail

• #### of

public static <T> FieldLUDecomposition<T> of​(FieldDenseMatrix<T> m)
Factory method.
Type Parameters:
T - Type of the field elements.
Parameters:
m - Matrix to decompose.
Returns:
a new instance.
• #### isSingular

public boolean isSingular()
Returns:
true if the matrix is singular.
• #### getL

public FieldDenseMatrix<T> getL()
Builds the "L" matrix of the decomposition.
Returns:
the lower triangular matrix.
Throws:
SingularMatrixException - if the matrix is singular.
• #### getU

public FieldDenseMatrix<T> getU()
Builds the "U" matrix of the decomposition.
Returns:
the upper triangular matrix.
Throws:
SingularMatrixException - if the matrix is singular.
• #### getP

public FieldDenseMatrix<T> getP()
Builds the "P" matrix.

P is a matrix with exactly one element set to one in each row and each column, all other elements being set to zero. The positions of the "one" elements are given by the pivot permutation vector.

Returns:
the "P" rows permutation matrix.
Throws:
SingularMatrixException - if the matrix is singular.
getPivot()
• #### getPivot

public int[] getPivot()
Gets the pivot permutation vector.
Returns:
the pivot permutation vector.
getP()
• #### getDeterminant

public T getDeterminant()
Return the determinant of the matrix.
Returns:
determinant of the matrix
• #### getSolver

public FieldDecompositionSolver<T> getSolver()
Creates a solver for finding the solution X of the linear system of equations A X = B.
Returns:
a solver.
Throws:
SingularMatrixException - if the matrix is singular.