Previous IDL Analyst Reference Guide: Linear Systems Next

IMSL_INV

Syntax | Return Value | Arguments | Keywords | Example | Errors | Version History

The IMSL_INV function computes the inverse of a real or complex, square matrix.


Note
This routine requires an IDL Analyst license. For more information, contact your ITT Visual Information Solutions sales or technical support representative.

Syntax

Result = IMSL_INV(a [,/DOUBLE])

Return Value

A two-dimensional matrix containing the inverse of the matrix A.

Arguments

a

Two-dimensional matrix containing the matrix to be inverted.

Keywords

DOUBLE

If present and nonzero, double precision is used.

Example

RM, a, 3, 3  
; Define the matrix to be inverted.  
row 0: 1 3 3  
row 1: 1 3 4  
row 2: 1 4 4  
ainv = IMSL_INV(a)  
; Call IMSL_INV to perform the inversion.  
PM, a  
; Output the original matrix.  
 1.00000      3.00000      3.00000  
 1.00000      3.00000      4.00000  
 1.00000      4.00000      4.00000  
     
PM, ainv  
; Output the computed inverse.  
  4.00000     -0.00000     -3.00000  
     0.00000     -1.00000      1.00000  
    -1.00000      1.00000      0.00000  
PM, a # ainv  
; Check the results.  
 1.00000      0.00000      0.00000  
 0.00000      1.00000      0.00000  
 0.00000      0.00000      1.00000  

Errors

Fatal Errors

MATH_SINGULAR_MATRIX—Input matrix is singular.

Version History

6.4
Introduced

  IDL Online Help (March 06, 2007)