I have a two-dimensional array in gams, which i'd like to convert into a one-dimensional array.
I.e. I have
set i /i1*i100/
set j /j1*j100/
parameter array(i,j)
And now I'd like something like:
set n /n1*n10000/
parameter one_dim_array(n)
And all elements of the above array should become elements of one_dim_array, by going over all rows and all columns and writing out the values.
I tried:
parameter index /0/
loop(i,
loop(j,
one_dim_array(n%index%) = array(i,j);
index = index + 1;
))
However, GAMS doesn't seem to understand this n%index% notation and returns an error that it's not a set. Any way to circumvent this?
Thanks a lot!