INVERT
- Attention
INVERT
is deprecated (see GAMS 36 Cholesky, Eigenvalue, Eigenvector, Invert release notes). Please use $libInclude linalg Invert instead.
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;