reset;
option solver cplex; # solver
param n := 5; # size of matrix A
param a {i in 1..n,j in 1..n} := Uniform(-1,1); # coefficients of A
var x {i in 1..n,j in 1..n}; # variables for inverse A^-1
#minimize LP: x[1,1]; # objective (not needed)
subject to NB {i in 1..n,j in 1..n}: # identity equations (AX=I)
sum{k in 1..n} a[i,k]*x[k,j] = if i=j then 1 else 0;
solve; # solution
display x; # output