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
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to