GAMS item dimension: Dim=, Rdim=, Cdim=

Top  Previous  Next

Nominally, the Gdxxrw program is set up to read and write a 2 dimensional data item i.e. a(i,j).  When the object is more or less than 2 dimensional, then the user must specify the dimension at hand and the way the data are arrayed in the spreadsheet.  Three command line parameters control this

Dim tells the total dimension i.e. 1 for a vector like r(i), 2 for a two dimensional matrix like a(i,j), 3 for a three dimensional item like b(i,j,k).
Cdim dimensions to be placed in columns of spreadsheet where the first Cdim rows of the data range will be used for labels.
Rdim dimensions to be placed in rows of spreadsheet where the first Rdim columns of the data range will be used for labels.

These are specified as

 

Dim=integer

Rdim=integer

Cdim=integer

 

Note they do not all need to be specified Dim equals the sum of Cdim and Rdim. and if both Cdim and Rdim are omitted, the program assumes that Cdim = 1 and Rdim= Dim – 1.

The set up of the Rdim and Cdim parameters is much like the option statement associated with a display as discussed in the Improving Output via Report Writing chapter.  Their use is illustrated below.