LA_CHOLSOL
Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also
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:
|
Output Type
|
LAPACK Routine
|
|---|---|
| Float |
|
| Double |
|
| Complex |
|
| Double complex |
|
For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
Syntax
Result = LA_CHOLSOL( A, B [, /DOUBLE] [, /UPPER] )
Return Value
The result is an n-element vector or k-by-n array.
Arguments
A
The n-by-n Cholesky factorization of an array, created by the LA_CHOLDC procedure.
B
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.
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 A is double precision, otherwise the default is DOUBLE = 0.
UPPER
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.
Examples
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:
When this program is compiled and run, IDL prints:
The exact solution vector is [-0.5, -1.0, 0.5].
Version History
See Also
CHOLSOL, LA_CHOLDC, LA_CHOLMPROVE