public class DenseFloatLUDecomposition extends Object implements Serializable
The LU decomposition with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
Constructor and Description |
---|
DenseFloatLUDecomposition(FloatMatrix2D A)
Constructs and returns a new LU Decomposition object; The decomposed
matrices can be retrieved via instance methods of the returned
decomposition object.
|
Modifier and Type | Method and Description |
---|---|
float |
det()
Returns the determinant, det(A).
|
FloatMatrix2D |
getL()
Returns the lower triangular factor, L.
|
int[] |
getPivot()
Returns a copy of the pivot permutation vector.
|
FloatMatrix2D |
getU()
Returns the upper triangular factor, U.
|
boolean |
isNonsingular()
Returns whether the matrix is nonsingular (has an inverse).
|
FloatMatrix1D |
solve(FloatMatrix1D b)
Solves A*x = b.
|
FloatMatrix2D |
solve(FloatMatrix2D B)
Solves A*X = B.
|
String |
toString()
Returns a String with (propertyName, propertyValue) pairs.
|
public DenseFloatLUDecomposition(FloatMatrix2D A)
A
- Rectangular matrixpublic float det()
IllegalArgumentException
- Matrix must be squarepublic FloatMatrix2D getL()
public int[] getPivot()
public FloatMatrix2D getU()
public boolean isNonsingular()
public FloatMatrix2D solve(FloatMatrix2D B)
B
- A matrix with as many rows as A and any number of
columns.IllegalArgumentException
- if B.rows() != A.rows().IllegalArgumentException
- if A is singular, that is, if
!this.isNonsingular().IllegalArgumentException
- if A.rows() < A.columns().public FloatMatrix1D solve(FloatMatrix1D b)
b
- A vector of size A.rows()IllegalArgumentException
- if b.size() != A.rows().IllegalArgumentException
- if A is singular, that is, if
!this.isNonsingular().IllegalArgumentException
- if A.rows() < A.columns().Jump to the Parallel Colt Homepage