GAMS Rev 142 Intel /Linux 02/01/06 08:43:51 Page 1 Example illustrating use of "display" options in GAMS C o m p i l a t i o n 2 3 set 4 i 'first index' /first, second/ 5 j 'second index' /one, two, three/ 6 k 'third index' /a, b/ 7 l 'fourth index' /i, ii/; 8 9 * define a four-dimensional parameter 10 parameter p(i,j,k,l) / 11 second.one.a.i +inf, first.three.b.i -6.3161 12 first.one.b.i 5.63559, second.two.b.i 19.3160 13 second.one.b.ii -17.63559, first.two.b.ii 10.3457 14 first.two.a.ii 0.0289404, second.one.a.ii 1.0037 15 second.two.a.ii +inf, first.two.a.i -2.939357 16 first.one.a.ii 0.0/; 17 18 * output of the default display statement 19 display p; 20 21 * use a global option 22 23 option decimals = 1; 24 display 'p = ',p; 25 26 * use different output formats. In general: 27 * option f:d:r:c; 28 * means that when displaying the "f" identifier we use 29 * d decimal places 30 * r of the dimensions are displayed in the row label 31 * c of the dimensions are displayed in the column label 32 33 * use 5 decimal places, three-dimensional row labels, 34 * one-dimensional column labels 35 36 option p:5:3:1; 37 display ' displaying p again... ',p; 38 39 * use 4 decimal places, two-dimensional row labels, 40 * two-dimensional column labels 41 42 option p:4:2:2; 43 display p; 44 45 * use 6 decimal places, one-dimensional row labels, 46 * two-dimensional column labels 47 48 option p:6:1:2; 49 display p; COMPILATION TIME = 0.269 SECONDS 3.2 Mb LNX217-142 Apr 27, 2005 GAMS Rev 142 Intel /Linux 02/01/06 08:43:51 Page 2 Example illustrating use of "display" options in GAMS E x e c u t i o n ---- 19 PARAMETER p INDEX 1 = first i ii one .b 5.636 two .a -2.939 0.029 two .b 10.346 three.b -6.316 INDEX 1 = second i ii one.a +INF 1.004 one.b -17.636 two.a +INF two.b 19.316 ---- 24 p = ---- 24 PARAMETER p INDEX 1 = first i ii one .b 5.6 two .a -2.9 2.894040E-2 two .b 10.3 three.b -6.3 INDEX 1 = second i ii one.a +INF 1.0 one.b -17.6 two.a +INF two.b 19.3 ---- 37 displaying p again... ---- 37 PARAMETER p i ii first .one .b 5.63559 first .two .a -2.93936 0.02894 first .two .b 10.34570 first .three.b -6.31610 second.one .a +INF 1.00370 second.one .b -17.63559 second.two .a +INF second.two .b 19.31600 ---- 43 PARAMETER p a.i a.ii b.i b.ii first .one 5.6356 first .two -2.9394 0.0289 10.3457 first .three -6.3161 second.one +INF 1.0037 -17.6356 second.two +INF 19.3160 ---- 49 PARAMETER p INDEX 1 = first a.i a.ii b.i b.ii one 5.635590 two -2.939357 0.028940 10.345700 three -6.316100 INDEX 1 = second a.i a.ii b.i b.ii one +INF 1.003700 -17.635590 two +INF 19.316000 EXECUTION TIME = 0.170 SECONDS 3.7 Mb LNX217-142 Apr 27, 2005 USER: Computer Sciences Dept. G050512/0001AS-LNX University of Wisconsin-Madison DC2621 License for teaching and research at degree granting institutions **** FILE SUMMARY Input /afs/cs.wisc.edu/u/s/w/swright/public/html/635/examples/display.gms Output /afs/cs.wisc.edu/u/s/w/swright/public/html/635/examples/display.lst