Monday, January 25, 2010

Unneeded loops in GAMS

From a post on the GAMS list:

yes if the data are to be aggregated one would have a one to many tuple and do sums, sma, smin or whatever is needed 


tuple(period,month,year) /1.(jar.1970,feb.1970,....)




I see many, many models where the LOOP is used without much reason. This is an example. The more correct way of writing this is by removing the loop construct and using the GAMS parallel assignment which gives an implicit loop:


No comments:

Post a Comment