INVERT

Table of Contents

INVERT inverts a matrix.

Usage

invert gdxin i a gdxout inva

where

gdxin

name of gdxfile with matrix

i

name of set used in matrix

a

name of 2 dimensional parameter inside gdxin

gdxout

name of gdxfile for results (inverse matrix)

inva

name of 2 dimensional parameter inside gdxout

Calculates the inverse of a matrix a(i,j), where i and j are aliased sets. The matrix inva in gdxout will contain the inverse.

Example

$ontext

   Finds the inverse of a matrix through an external program
 
   Erwin Kalvelagen, march 2005
 
   Reference: model gauss.gms from the model library
              http://www.gams.com/modlib/libhtml/gauss.htm
 
$offtext
 
set i  /i1*i3 /;
alias (i,j);
 
table a(i,j) 'original matrix'
      i1     i2     i3
i1    1      2      3
i2    1      3      4
i3    1      4      3
;
 
parameter inva(i,j) 'inverse of a';
 
execute_unload 'a.gdx',i,a;
execute '=invert.exe a.gdx i a b.gdx inva';
execute_load 'b.gdx',inva;
 
display a,inva;