Re: MathProg two-dimensional array
"Heinrich Schuchardt" <[email protected]>
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <trinity-41371ca2-0613-40a9-81c7-cb9a54c87c37-1507452620801@msvc-mesg-gmx019> |
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, "[email protected]" <[email protected]> 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 [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk