# IMSL_CHFAC

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

Note: This routine requires an IDL Analyst license. For more information, contact your Exelis VIS 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.

## Example

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'

Cholesky factor

1.00000 -3.00000 2.00000

-3.00000 1.00000 1.00000

2.00000 1.00000 1.00000

## Syntax

IMSL_CHFAC, a, fac [,CONDITION=variable] [, /DOUBLE] [, INVERSE=variable]

## Arguments

### a

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

### fac

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.

## Keywords

### CONDITION

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

### DOUBLE

If present and nonzero, double precision is used.

### INVERSE

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

## Errors

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

6.4 | Introduced