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:
The following example program computes the Cholesky decomposition of a given symmetric positive-definite array:
; 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
; 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)
When this program is compiled and run, IDL prints:
LA_CHOLDC Error: 2.38419e-007
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).
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.
Set this keyword to a named variable that will contain the status of the computation. Possible values are:
- STATUS = 0: The computation was successful.
- STATUS > 0: The array is not positive definite and the factorization could not be completed. The STATUS value specifies the order of the leading minor which is not positive definite.
Note: If STATUS is not specified, any error messages will output to the screen.
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.
Resources and References
For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.