\PhpOffice\PhpSpreadsheet\Shared\JAMAQRDecomposition

For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R.

The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns false.

Summary

Methods
Properties
Constants
__construct()
isFullRank()
getH()
getR()
getQ()
solve()
No public properties found
MATRIX_RANK_EXCEPTION
No protected methods found
No protected properties found
N/A
No private methods found
$QR
$m
$n
$Rdiag
N/A

Constants

MATRIX_RANK_EXCEPTION

MATRIX_RANK_EXCEPTION = 'Can only perform operation on full-rank matrix.'

Properties

$QR

$QR : array

Array for internal storage of decomposition.

Type

array

$m

$m : integer

Row dimension.

Type

integer

$n

$n : integer

Column dimension.

Type

integer

$Rdiag

$Rdiag : array

Array for internal storage of diagonal of R.

Type

array

Methods

__construct()

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

QR Decomposition computed by Householder reflections.

Parameters

\PhpOffice\PhpSpreadsheet\Shared\JAMA\matrix $A

Rectangular matrix

isFullRank()

isFullRank() : boolean

Is the matrix full rank?

Returns

boolean —

true if R, and hence A, has full rank, else false

getH()

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

Return the Householder vectors.

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

Lower trapezoidal matrix whose columns define the reflections

getR()

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

Return the upper triangular factor.

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

upper triangular factor

getQ()

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

Generate and return the (economy-sized) orthogonal factor.

Returns

\PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix —

orthogonal factor

solve()

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

Least squares solution of 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 —

matrix that minimizes the two norm of QRX-B