LA_LUSOL
Syntax | Return Value | Arguments | Keywords | Examples | Version History | See Also
The LA_LUSOL function is used in conjunction with the LA_LUDC procedure to solve a set of n linear equations in n unknowns, AX = B. The parameter A is not the original array, but its LU decomposition, created by the routine LA_LUDC.
The LA_LUSOL 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_LUSOL is based on the following LAPACK routines:
|
Output Type
|
LAPACK Routine
|
|---|---|
| Float |
|
| Double |
|
| Complex |
|
| Double complex |
|
For details see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
Syntax
Result = LA_LUSOL( A, Index, B [, /DOUBLE] )
Return Value
The result is an n-element vector or k-by-n array.
Arguments
A
The n-by-n LU decomposition of an array, created by the LA_LUDC procedure.
Note
LA_LUSOL cannot accept any non-square output generated by LA_LUDC.
Index
An n-element input vector, created by the LA_LUDC procedure, containing the row permutations which occurred as a result of partial pivoting.
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.
Examples
Given the system of equations:
the solution can be derived with the following code:
IDL prints:
The exact solution to 6 decimal places is [-0.397432, -0.334865, 0.321149].
Note
UNIX users may see slightly different output results.
Version History
See Also
LA_LINEAR_EQUATION, LA_LUDC, LA_LUMPROVE, LUSOL