idxperm1.gms : Check correct behavior when permuting indices in model generation

Description

With GAMS 24.5 we improved the execution time for cases were the index order of
symbols was not sorted, meaning not in the order of the controlling sets. This
is done by changing the internal sparsity trees on the fly.
While testing there was an error that could be reproduced with this example,
which contains a combination of the following "features": Unordered indizes,
which get permuted later (p(j,i) and var(j,i)), a controlling index that is
influenced by this permutation and is not the domain of all symbols that it
controlls (i, p(*,*)), an equation that is limited to a subset of this
controlling index (yp(i)$si(i)..).
Before this error was fixed we got an execution error:

     Exec Error at line 35: Equation defined more than once

Keyword: Sys17

Contributor: Lutz Westermann, September 2015


Small Model of Type : GAMS


Category : GAMS Test library


Main file : idxperm1.gms

$title 'Check correct behavior when permuting indices in model generation' (IDXPERM1,SEQ=684)

$onText
With GAMS 24.5 we improved the execution time for cases were the index order of
symbols was not sorted, meaning not in the order of the controlling sets. This
is done by changing the internal sparsity trees on the fly.
While testing there was an error that could be reproduced with this example,
which contains a combination of the following "features": Unordered indizes,
which get permuted later (p(j,i) and var(j,i)), a controlling index that is
influenced by this permutation and is not the domain of all symbols that it
controlls (i, p(*,*)), an equation that is limited to a subset of this
controlling index (yp(i)$si(i)..).
Before this error was fixed we got an execution error:

**** Exec Error at line 35: Equation defined more than once

Keyword: Sys17

Contributor: Lutz Westermann, September 2015
$offText


set i /i1*i5  /
    j /j1*j100/
    k /k1*k10 /
    si(i);

parameter p;
p(j,i) = uniformint(0,1);

equation obj, yp(i);
variable z, var(j,i);

obj..          z                                            =e= 1;
yp(i)$si(i)..  sum(j$p(j,i), var(j,i)) - sum((k,j), p(j,i)) =e= 0;

model m /all/;

si('i3') = yes;
solve m min z use lp;

abort$(   m.modelstat<>%modelStat.optimal%
       or m.solvestat<>%solveStat.normalCompletion%) 'Problem during solve';