public class DMatrixLud
extends java.lang.Object
The LU decomposition with pivoting always exists, even for singular matrices A. The primary use of LU decomposition is in the solution of square systems of simultaneous linear equations. These solutions will fila if the matrix A is singular.
This class was adapted from the package Jama, which was developed by Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the National Institue of Standards and Technology.
Constructor and Description |
---|
DMatrixLud(DMatrix a)
Constructs an LU decomposition for the specified matrix A.
|
Modifier and Type | Method and Description |
---|---|
double |
det()
Returns the determinant of the matrix A.
|
DMatrix |
getL()
Gets the m-by-n unit lower triangular matrix factor L.
|
int[] |
getPivot()
Gets the pivot vector, an array of length m.
|
DMatrix |
getU()
Gets the n-by-n upper triangular matrix factor U.
|
boolean |
isNonSingular()
Determines whether the matrix A is non-singular.
|
boolean |
isSingular()
Determines whether the matrix A is singular.
|
DMatrix |
solve(DMatrix b)
Returns the solution X of the system A*X = B.
|
public DMatrixLud(DMatrix a)
a
- the matrix A.public boolean isNonSingular()
public boolean isSingular()
public DMatrix getL()
public DMatrix getU()
public int[] getPivot()
public DMatrix solve(DMatrix b)
b
- a matrix of right-hand-side vectors. This matrix must
have the same number (m) of rows as the matrix A, but may have
any number of columns.java.lang.IllegalStateException
- if A is singular.public double det()
java.lang.IllegalStateException
- if A is not square.