Triangular Factorization of Positive Definite Matrices (trf)

trf computes the Cholesky factorization of a real symmetric positive definite matrix \( A \).

Real Variant

The Cholesky decomposition is used to factor \( A \) as

where \( U \) is an upper triangular matrix and \( L \) is a lower triangular matrix.

A

(input/output) real valued SyMatrix
On entry, the symmetric matrix \( A \) stored either in the upper or lower triangular part of \( A \). The other part is not referenced.

On exit, if the return value is zero, the factor \( U \) or \( L \) from the Cholesky factorization \( A = U^T U \) or \( A = L L^T \).

Return value:

i=0

Successful exit.

i>0

The leading minor of order \( i \) is not positive definite, and the factorization could not be completed.

Complex Variant

The Cholesky decomposition is used to factor \( A \) as

where \( U \) is an upper triangular matrix and \( L \) is a lower triangular matrix. The factored form of \( A \) is then used to solve the system of equations \( A X = B \).

A

(input/output) complex valued HeMatrix
On entry, the hermitian matrix \( A \) stored either in the upper or lower triangular part of \( A \). The other part is not referenced.

On exit, if the return value is zero, the factor \( U \) or \( L \) from the Cholesky factorization \( A = U^T U \) or \( A = L L^T \).

Return value:

i=0

Successful exit.

i>0

The leading minor of order \( i \) is not positive definite, and the factorization could not be completed.