[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] MathProg two-dimensional array
From: |
address@hidden |
Subject: |
[Help-glpk] MathProg two-dimensional array |
Date: |
Sun, 8 Oct 2017 09:43:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
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