class LUDecomposition (View source)

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.

## Constants

 MATRIX_SINGULAR_EXCEPTION MATRIX_SQUARE_EXCEPTION

## Methods

__construct(Matrix \$A)

LU Decomposition constructor.

getL()

Get lower triangular factor.

getU()

Get upper triangular factor.

array
getPivot()

Return pivot permutation vector.

getDoublePivot()

Alias for getPivot.

bool
isNonsingular()

Is the matrix nonsingular?

array
det()

Count determinants.

solve(mixed \$B)

Solve A*X = B.

## Details

### at line 69``` __construct(Matrix \$A) ```

LU Decomposition constructor.

#### Parameters

 Matrix \$A Rectangular matrix

### at line 136``` Matrix getL() ```

Get lower triangular factor.

#### Return Value

 Matrix Lower triangular factor

### at line 160``` Matrix getU() ```

Get upper triangular factor.

#### Return Value

 Matrix Upper triangular factor

### at line 182``` array getPivot() ```

Return pivot permutation vector.

#### Return Value

 array Pivot vector

### at line 194``` getDoublePivot() ```

Alias for getPivot.

see getPivot

### at line 206``` bool isNonsingular() ```

Is the matrix nonsingular?

#### Return Value

 bool true if U, and hence A, is nonsingular

### at line 224``` array det() ```

Count determinants.

#### Return Value

 array d matrix deterninat

### at line 250``` Matrix solve(mixed \$B) ```

Solve A*X = B.

#### Parameters

 mixed \$B a Matrix with as many rows as A and any number of columns

#### Return Value

 Matrix X so that LUX = B(piv,:)

#### Exceptions

 Exception illegalArgumentException Matrix row dimensions must agree Exception runtimeException Matrix is singular