The LA_CHOLSOL function is used in conjunction with the LA_CHOLDC to solve a set of n linear equations in n unknowns, AX = B, where A must be a symmetric (or Hermitian) positive-definite array. The parameter A is input not as the original array, but as its Cholesky decomposition, created by the routine LA_CHOLDC.
The LA_CHOLSOL function may also be used to solve for multiple systems of linear equations, with each column of B representing a different set of equations. In this case, the result is a k-by-n array where each of the k columns represents the solution vector for that set of equations.
LA_CHOLSOL is based on the following LAPACK routines:
Given the following system of equations:
6u + 15v + 55w = 9.5
15u + 55v + 225w = 50
55u + 225v + 979w = 237
The solution can be derived by using the following program:
; Define the coefficient array:
a = [[6.0, 15.0, 55.0], $
[15.0, 55.0, 225.0], $
[55.0, 225.0, 979.0]]
; Define the right-hand side vector b:
b = [9.5, 50.0, 237.0]
; Compute the Cholesky decomposition of a:
achol = a ; make a copy
; Compute and print the solution:
x = LA_CHOLSOL(achol, b)
PRINT, 'LA_CHOLSOL solution:', x
When this program is compiled and run, IDL prints:
-0.499999 -1.00000 0.500000
The exact solution vector is [-0.5, -1.0, 0.5].
The result is an n-element vector or k-by-n array.
The n-by-n Cholesky factorization of an array, created by the LA_CHOLDC procedure.
An n-element input vector containing the right-hand side of the linear system, or a k-by-n array, where each of the k columns represents a different linear system.
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 A is double precision, otherwise the default is DOUBLE = 0.
Set this keyword if A contains the upper triangular array, rather than the lower triangular array.
Note: If the UPPER keyword is set in the LA_CHOLDC then the UPPER keyword must also be set in LA_CHOLSOL.
Resources and References
For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
This page has no user notes yet. Be the first one!