help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] MathProg two-dimensional array


From: Heinrich Schuchardt
Subject: Re: [Help-glpk] MathProg two-dimensional array
Date: Sun, 8 Oct 2017 10:50:20 +0200

Hello Ralf,

please, have a look at the examples directory of the source distribution, e.g. sudoku.mod and at gmpl.pdf.

Regards

Heinrich



Am 08.10.17, 09:43, "address@hidden" <address@hidden> schrieb:
Hello everyone,

trying to define arrays with two dimensions, I could not
solve this topic in GMPL:


set ORIG;
set DEST;
set LINKS within {ORIG,DEST};

printf {i in ORIG, j in DEST} "LINKS[%s,%s] = %g \n",i,j,LINKS[i][j];

data;

set ORIG := GARY CLEV PITT;
set DEST := FRA DET LAN WIN STL FRE LAF;

set LINKS :=
(GARY,*) DET LAN STL LAF
(CLEV,*) FRA DET LAN WIN STL LAF
(PITT,*) FRA WIN STL FRE;

end;


This definition brings up this error message:

"LINKS cannot be subscripted"


So my question is: how can I define Links so, that it can be accessed
with this command:

Links[i][j]


Thanks for any comments!



Ralf




_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]