\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 : int

Row dimension.

Type

int

$n

$n : int

Column dimension.

Type

int

$pivsign

$pivsign : int

Pivot sign.

Type

int

$piv

$piv : array

Internal storage of pivot vector.

Type

array

Methods

__construct()

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

LU Decomposition constructor.

Parameters

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

Rectangular matrix

Returns

mixed —

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() : mixed

Alias for getPivot.

@see getPivot

Returns

mixed —

isNonsingular()

isNonsingular() : bool

Is the matrix nonsingular?

Returns

bool —

true if U, and hence A, is nonsingular

det()

det() : array

Count determinants.

Returns

array —

d matrix deterninat

solve()

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

Solve A*X = B.

Parameters

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix $B

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

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

X so that LUX = B(piv,:)