Page 1 of 1

Change the sequence of the dimensions

Posted: Mon Jan 21, 2019 5:31 pm
by Basstoelpel
Hello,

I want to change the sequence of the dimensions of the parameter tch from tch (c,*,t) to tch(t,c,*). Is that possible and if how?

Thanks in advance

Re: Change the sequence of the dimensions

Posted: Tue Jan 22, 2019 5:59 am
by bussieck
There is no magic to this. Just do it in the declaration and at every place you use tch. There is not automation help to refactor your code this way (neither in the IDE not in Studio). You need to do this manually.

-Michael

Re: Change the sequence of the dimensions

Posted: Tue Jan 22, 2019 7:50 am
by Basstoelpel
Hi Michael,

thanks for your reply. I must have been unprecise.

Due to the data structure from an Excel input (which I don't want to change), it is not possible to change the declaration. I was wondering whether there is a leaner way than introducing a second parameter tch2(t,c,*) = tch(c,*,t).

Re: Change the sequence of the dimensions

Posted: Tue Jan 22, 2019 9:19 am
by bussieck
No, unfortunately not. The following code does a fast copy and frees up memory used by tch (if this is not needed anymore):

Code: Select all

Parameter tch(c,*,t), tch2(t,c,*);
$gdxin fromExcel
$load tch
option tch2<tch, clear=tch;
-Michael

Re: Change the sequence of the dimensions

Posted: Tue Jan 22, 2019 9:58 am
by Basstoelpel
Too bad. Anyway thanks for your support!