|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnr.LUDecomposition
public class LUDecomposition
LU Decomposition. Copied from the jama package from the NIST, but using nr.Mat and limited to square matrices
For an n-by-n matrix A, the LU decomposition is an n-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length n so that A(piv,:) = L*U.
The LU decompostion 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. Since this was developed by the US government, it is in the public domain.
Constructor Summary | |
---|---|
LUDecomposition(Mat A)
LU Decomposition |
Method Summary | |
---|---|
double |
determinant()
Returns the determinant |
double[] |
getDoublePivot()
Returns the pivot permutation vector as a one-dimensional double array |
Mat |
getL()
Returns the lower triangular factor |
int[] |
getPivot()
Returns the pivot permutation vector |
Mat |
getU()
Returns the upper triangular factor |
Mat |
inverse()
find the inverse by solving for each column of the identity matrix. |
boolean |
isNonsingular()
Is the matrix nonsingular? |
Vec |
solve(Vec B)
Solve A*X = B |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LUDecomposition(Mat A)
A
- A square matrixMethod Detail |
---|
public boolean isNonsingular()
public Mat getL()
public Mat getU()
public int[] getPivot()
public double[] getDoublePivot()
public double determinant()
public Vec solve(Vec B) throws DidNotConvergeException
solve
in interface MatDecomposition
B
- a Vec
DidNotConvergeException
- if B is singular.public Mat inverse()
inverse
in interface MatDecomposition
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |