The IMSL_CHFAC procedure computes the Cholesky factor, L, of a real or complex symmetric positive definite matrix A, such that A = LLH.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The IMSL_CHFAC procedure 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 IMSL_CHFAC function fails if L, the lower-triangular matrix in the factorization, has a zero diagonal element.


This example computes the Cholesky factorization of a 3 x 3 matrix.

RM, a, 3, 3
; Define the matrix A.
row 0: 1 -3 2
row 1: -3 10 -5
row 2: 2 -5 6
IMSL_CHFAC, a, fac
; Call IMSL_CHFAC to compute the factorization.
PM, fac, Title = 'Cholesky factor'

IDL prints:

Cholesky factor
  1.00000 -3.00000 2.00000
  -3.00000 1.00000 1.00000
  2.00000 1.00000 1.00000


IMSL_CHFAC, A, Fac [,CONDITION=variable] [, /DOUBLE] [, INVERSE=variable]



Two-dimensional matrix containing the coefficient matrix. Element A (i, j) contains the j-th coefficient of the i-th equation.


A named variable that will contain a two-dimensional matrix containing the Cholesky factorization of A. Note that Fac contains L in the lower triangle and LH in the upper triangle.


CONDITION (optional)

Named variable into which an estimate of the L1 condition number is stored. The CONDITION and FACTOR keywords cannot be used together.

DOUBLE (optional)

If present and nonzero, double precision is used.

INVERSE (optional)

Specifies a named variable into which the inverse of the matrix A is stored. This keyword is not allowed if A is complex.


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 #.

Version History



See Also