khaeru/py-gdx

Construct "implicit sets" for *

Closed this issue · 0 comments

For GAMS parameters declared using the universal set, like parameter foo(*,*,*), PyGDX tries to find an existing GAMS set for each dimension indexed by *. Where no existing set matches, the dimension is left as *; but when * has many elements, this results in high memory use when trying to load foo.

Add code and an option for the File constructor to create the implicit sets for each dimension of a loaded parameter. For instance, create sets named _foo_1, _foo_2, and _foo_3, so that the parameter is foo(_foo_1,_foo_2,_foo_3). This will avoid the memory use problem in most practical situations.