The LA_INVERT function uses LU decomposition to compute the inverse of a square array.
LA_INVERT is based on the following LAPACK routines:
|
Output Type
|
LAPACK Routine
|
|---|---|
|
Float
|
sgetrf, sgetri |
|
Double
|
dgetrf, dgetri |
|
Complex
|
cgetrf, cgetri |
|
Double complex
|
zgetrf, zgetri |
For more details, see Anderson et al., LAPACK Users' Guide, 3rd ed., SIAM, 1999.
Result = LA_INVERT( A [, /DOUBLE] [, STATUS=variable] )
The result is an array of the same dimensions as the input array.
The n-by-n array to be inverted.
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 to a named variable that will contain the status of the computation. Possible values are:
| Note |
The following program computes the inverse of a square array:
PRO ExLA_INVERT ; Create a square array. array =[[1d, 2, 1], $ [4, 10, 15], $ [3, 7, 1]] ; Compute the inverse and check the error. ainv = LA_INVERT(array) PRINT, 'LA_INVERT Identity Matrix:' PRINT, ainv ## array END
When this program is compiled and run, IDL prints:
A_INVERT Identity Matrix: 1.0000000 1.7763568e-015 6.6613381e-016 0.00000000 1.0000000 1.2212453e-015 0.00000000 0.00000000 1.0000000
Introduced 5.6