golib
0.5
|
#include <golu.h>
Public Member Functions | |
LU (const goMath::Matrix< Real > &A) | |
int | isNonsingular () |
goMath::Matrix< Real > | getL () |
goMath::Matrix< Real > | getU () |
goMath::Vector< int > | getPivot () |
Real | det () |
bool | solve (const goMath::Matrix< Real > &B, goMath::Matrix< Real > &retValue) |
bool | solve (const goMath::Vector< Real > &b, goMath::Vector< Real > &retValue) |
LU Decomposition.
Taken in large parts from the JAMA library (free of copyright).
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n.
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.
|
inline |
|
inline |
Compute determinant using LU factors.
|
inline |
Return lower triangular factor
|
inline |
Return pivot permutation vector
|
inline |
Return upper triangular factor
|
inline |
Is the matrix nonsingular?
|
inline |
Solve A*X = B
B | A Matrix with as many rows as A and any number of columns. |
|
inline |
Solve A*x = b, where x and b are vectors of length equal
to the number of rows in A.
b | a vector (goMath::Vector> of length equal to the first dimension of A. |