Previous IDL Reference Guide: Procedures and Functions Next

LA_CHOLDC

Syntax | Arguments | Keywords | Examples | Version History | See Also

The LA_CHOLDC procedure computes the Cholesky factorization of an n-by-n symmetric (or Hermitian) positive-definite array as:

If A is real: A = UT U or A = L LT

If A is complex: A = UH U or A = L LH

where U and L are upper and lower triangular arrays. The T represents the transpose while H represents the Hermitian, or transpose complex conjugate.

LA_CHOLDC is based on the following LAPACK routines:

Table 3-52: LAPACK Routine Basis for LA_CHOLDC

Table 3-52: LAPACK Routine Basis for LA_CHOLDC
Output Type
LAPACK Routine
Float
spotrf
Double
dpotrf
Complex
cpotrf
Double complex
zpotrf

For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.

Syntax

LA_CHOLDC, Array [, /DOUBLE] [, STATUS=variable] [, /UPPER]

Arguments

Array

A named variable containing the real or complex array to be factorized. Only the lower triangular portion of Array is used (or upper if the UPPER keyword is set). This procedure returns Array as a lower triangular array from the Cholesky decomposition (upper triangular if the UPPER keyword is set).

Keywords

DOUBLE

Set this keyword to use double-precision for computations and to return a double-precision (real or complex) result. Set DOUBLE = 0 to use single-precision for computations and to return a single-precision (real or complex) result. The default is /DOUBLE if Array is double precision, otherwise the default is DOUBLE = 0.

STATUS

Set this keyword to a named variable that will contain the status of the computation. Possible values are:

UPPER

If this keyword is set, then only the upper triangular portion of Array is used, and the upper triangular array is returned. The default is to use the lower triangular portion and to return the lower triangular array.

Examples

The following example program computes the Cholesky decomposition of a given symmetric positive-definite array:

PRO ExLA_CHOLDC  
; Create a symmetric positive-definite array.  
n = 10  
seed = 12321  
array = RANDOMU(seed, n, n)  
array = array ## TRANSPOSE(Array)  
  
; Compute the Cholesky decomposition.  
lower = array    ; make a copy  
LA_CHOLDC, lower  
  
; Zero out the upper triangular portion.  
for i = 0,n - 2 Do lower[i+1:*,i] = 0  
  
; Reconstruct the array and check the difference  
arecon = lower ## TRANSPOSE(lower)  
PRINT, 'LA_CHOLDC Error:', MAX(ABS(arecon - array))  
END  

When this program is compiled and run, IDL prints:

LA_CHOLDC Error:   
4.76837e-007  

Version History

5.6
Introduced

See Also

CHOLDC, LA_CHOLMPROVE, LA_CHOLSOL

  IDL Online Help (March 06, 2007)