CHFAC Procedure
Computes the Cholesky factor, L, of a real or complex symmetric positive definite matrix A, such that A = LLH.
Usage
CHFAC, a, fac
Input Parameters
a—Two-dimensional matrix containing the coefficient matrix. Element A (i, j) contains the jth coefficient of the ith equation.
Output Parameters
fac—Two-dimensional matrix containing the Cholesky factorization of A. Note that fac contains L in the lower triangle and LH in the upper triangle.
Input Keywords
Double—If present and nonzero, double precision is used.
Output Keywords
Condition—Specifies a named variable into which an estimate of the L1 condition number is stored.
Inverse—Specifies a named variable into which the inverse of the matrix A is stored. This keyword is not allowed if A is complex.
Discussion
Procedure CHFAC computes the Cholesky factorization LLH of a symmetric positive definite matrix A. When the inverse of the matrix is sought, an estimate of the L1 condition number of A is computed using the same algorithm as in Dongarra et al. (1979). If the estimated condition number is greater than 1/ε (where ε is the machine precision), a warning message is issued. This indicates that very small changes in A may produce large changes in the solution x.
The CHFAC function fails if L, the lower-triangular matrix in the factorization, has a zero diagonal element.
Example
This example computes the Cholesky factorization of a 3 x 3 matrix.
; Define the matrix A.
RM, a, 3, 3
row 0:  1  -3  2
row 1: -3  10 -5
row 2:  2  -5  6
; Call CHFAC to compute the factorization.
CHFAC, a, fac
PM, fac, Title = 'Cholesky factor'
; PV-WAVE prints the following:
; Cholesky factor
;  1.00000     -3.00000      2.00000
; -3.00000      1.00000      1.00000
;  2.00000      1.00000      1.00000
Warning Errors
MATH_ILL_CONDITIONED—Input matrix is too ill-conditioned. An estimate of the reciprocal of its L1 condition number is #. The solution might not be accurate.
Fatal Errors
MATH_NONPOSITIVE_MATRIX—Leading # by # submatrix of the input matrix is not positive definite.
MATH_SINGULAR_MATRIX—Input matrix is singular.
MATH_SINGULAR_TRI_MATRIX—Input triangular matrix is singular. The index of the first zero diagonal element is #.