TemplateJAMA::LU class Reference

Main Page Namespace List Compound List File List Compound Members

# JAMA::LU Class Template Reference

`#include <jama_lu.h>`

List of all members.

## Public Methods
| LU (const Array2D< Real > &A)
int | isNonsingular ()
Array2D<Real> | getL ()
Array2D<Real> | getU ()
Array1D<int> | getPivot ()
Real | det ()
Array2D<Real> | solve (const Array2D< Real > &B)
Array1D<Real> | solve (const Array1D< Real > &b)

## Detailed Description

### template<class Real> class JAMA::LU

LU Decomposition.

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.

## Constructor & Destructor Documentation

template<class Real>
JAMA::LU<Real>::LU<Real> ( | const Array2D< Real > & A )`[inline]`

  | LU Decomposition Parameters:
  A | Rectangular matrix
Returns: LU Decomposition object to access L, U and piv.

## Member Function Documentation

template<class Real>
Real JAMA::LU<Real>::det ( | )`[inline]`

| Compute determinant using LU factors. Returns: determinant of A, or 0 if A is not square.

template<class Real>
Array2D< Real > JAMA::LU<Real>::getL ( | )`[inline]`

| Return lower triangular factor Returns: L

template<class Real>
Array1D< int > JAMA::LU<Real>::getPivot ( | )`[inline]`

| Return pivot permutation vector Returns: piv

template<class Real>
Array2D< Real > JAMA::LU<Real>::getU ( | )`[inline]`

| Return upper triangular factor Returns: U portion of LU factorization.

template<class Real>
int JAMA::LU<Real>::isNonsingular ( | )`[inline]`

| Is the matrix nonsingular? Returns: 1 (true) if upper triangular factor U (and hence A) is nonsingular, 0 otherwise.

template<class Real>
Array1D< Real > JAMA::LU<Real>::solve ( | const Array1D< Real > & b )`[inline]`

  | Solve A*x = b, where x and b are vectors of length equal to the number of rows in A. Parameters:
  b | a vector (Array1D> of length equal to the first dimension of A.
Returns: x a vector (Array1D> so that L*U*x = b(piv), if B is nonconformant, returns 0x0 (null) array.

template<class Real>
Array2D< Real > JAMA::LU<Real>::solve ( | const Array2D< Real > & B )`[inline]`

  | Solve A*X = B Parameters:
  B | A Matrix with as many rows as A and any number of columns.
Returns: X so that L*U*X = B(piv,:), if B is nonconformant, returns 0x0 (null) array.

The documentation for this class was generated from the following file:

- jama_lu.h