MathProg two-dimensional array

"[email protected]" <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.