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:
For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
LA_CHOLDC, Array [, /DOUBLE] [, STATUS=variable] [, /UPPER]
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:
| Note |
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.
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
Introduced 5.6
CHOLDC, LA_CHOLMPROVE, LA_CHOLSOL