\PhpOffice\PhpSpreadsheet\Shared\JAMALUDecomposition

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.

Summary

Methods
Properties
Constants
__construct()
getL()
getU()
getPivot()
getDoublePivot()
isNonsingular()
det()
solve()
No public properties found
MATRIX_SINGULAR_EXCEPTION
MATRIX_SQUARE_EXCEPTION
No protected methods found
No protected properties found
N/A
No private methods found
$LU
$m
$n
$pivsign
$piv
N/A

Constants

MATRIX_SINGULAR_EXCEPTION

MATRIX_SINGULAR_EXCEPTION = 'Can only perform operation on singular matrix.'

MATRIX_SQUARE_EXCEPTION

MATRIX_SQUARE_EXCEPTION = 'Mismatched Row dimension'

Properties

$LU

$LU : array

Decomposition storage.

Type

array

$m

$m : integer

Row dimension.

Type

integer

$n

$n : integer

Column dimension.

Type

integer

$pivsign

$pivsign : integer

Pivot sign.

Type

integer

$piv

$piv : array

Internal storage of pivot vector.

Type

array

Methods

__construct()

__construct(\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix  $A) 

LU Decomposition constructor.

Parameters

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix $A

Rectangular matrix

getL()

getL() : \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix

Get lower triangular factor.

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

Lower triangular factor

getU()

getU() : \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix

Get upper triangular factor.

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

Upper triangular factor

getPivot()

getPivot() : array

Return pivot permutation vector.

Returns

array —

Pivot vector

getDoublePivot()

getDoublePivot() 

Alias for getPivot.

@see getPivot

isNonsingular()

isNonsingular() : boolean

Is the matrix nonsingular?

Returns

boolean —

true if U, and hence A, is nonsingular

det()

det() : array

Count determinants.

Returns

array —

d matrix deterninat

solve()

solve(mixed  $B) : \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix

Solve A*X = B.

Parameters

mixed $B

a Matrix with as many rows as A and any number of columns

Throws

\PhpOffice\PhpSpreadsheet\Calculation\Exception

illegalArgumentException Matrix row dimensions must agree

\PhpOffice\PhpSpreadsheet\Calculation\Exception

runtimeException Matrix is singular

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

X so that LUX = B(piv,:)