IMSL Mathematics Reference Guide > Linear Systems > INV Function (PV-WAVE Advantage)
  

INV Function (PV-WAVE Advantage)
Computes the inverse of a real or complex, square matrix.
Usage
result = INV(a)
Input Parameters
a—Two-dimensional matrix containing the matrix to be inverted.
Returned Value
result—A two-dimensional matrix containing the inverse of the matrix A.
Input Keywords
Double—If present and nonzero, double precision is used.
Example
; Define the matrix to be inverted.
RM, a, 3, 3
row 0: 1 3 3
row 1: 1 3 4
row 2: 1 4 4
; Call INV to perform the inversion.
ainv = INV(a)
; Output the original matrix.
PM, a
; PV-WAVE prints the following:
; 1.00000      3.00000      3.00000
; 1.00000      3.00000      4.00000
; 1.00000      4.00000      4.00000
; Output the computed inverse.
PM, ainv
; PV-WAVE prints the following:
; 4.00000     -0.00000     -3.00000
; 0.00000     -1.00000      1.00000
; -1.00000      1.00000      0.00000
; Check the results.
PM, a # ainv
; PV-WAVE prints the following:
; 1.00000      0.00000      0.00000
; 0.00000      1.00000      0.00000
; 0.00000      0.00000      1.00000
Fatal Errors
MATH_SINGULAR_MATRIX—Input matrix is singular.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.