Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

CHOLSOL


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

The CHOLSOL function returns an n-element vector containing the solution to the set of linear equations Ax = b, where A is the positive-definite symmetric array returned by the CHOLDC procedure.

CHOLSOL is based on the routine cholsl described in section 2.9 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.

Note
If you are working with complex inputs, instead use the LA_CHOLSOL procedure.

Syntax

Result = CHOLSOL( A, P, B [, /DOUBLE] )

Return Value

Returns an n-element vector containing the solution to the set of linear equations Ax = b, where A is the positive-definite symmetric array returned by the CHOLDC.

Arguments

A

An n by n positive-definite symmetric array, as output by CHOLDC. Only the lower triangle of A is accessed.

P

The diagonal elements of the Cholesky factor L, as computed by CHOLDC.

B

An n-element vector containing the right-hand side of the equation.

Keywords

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

Examples

To solve a positive-definite symmetric system Ax = b:

;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 Cholesky decomposition of A: 
CHOLDC, A, P 
 
;Compute and print the solution: 
PRINT, CHOLSOL(A, P, B) 

IDL prints:

  -0.499998  -1.00000  0.500000 

The exact solution vector is [-0.5, -1.0, 0.5].

Version History

Introduced: 4.0

See Also

CHOLDC, CRAMER, GS_ITER, LA_CHOLSOL, LU_COMPLEX, LUSOL, SVSOL, TRISOL


Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]