idxperm4.gms : Check correct behavior when permuting indices of symbol using same controlling set multiple times

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.
The problem occured if we reference a symbol that depends more than once on the
same controlling set.

Keyword: Sys17

Contributor: Lutz Westermann, October 2015


Small Model of Type : GAMS


Category : GAMS Test library


Main file : idxperm4.gms

$title 'Check correct behavior when permuting indices of symbol using same controlling set multiple times' (IDXPERM4,SEQ=688)

$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.
The problem occured if we reference a symbol that depends more than once on the
same controlling set.

Keyword: Sys17

Contributor: Lutz Westermann, October 2015
$offtext

$onEcho > test.gms
set i / i1*i100 /
    t / t1*t4   /
    j / j1*j100 /;

parameter  par(j,i,t,t)
           sumPar(t);

par(j,i,t,t) = uniform(0, 1);

* Problematic assignment
sumPar(t) = sum((i,j), par(j,i,t,t));

variable z;
equation e;
* Same thing in equation
e.. z =e= sum((t,i,j), par(j,i,t,t));

model m /e/;
solve m use lp min z;
$offEcho

$call gams test.gms lo=%GAMS.lo% sys17=1 gdx=old.gdx
$if errorlevel 1 $abort problem running with sys17=1

$call gams test.gms lo=%GAMS.lo% sys17=0 gdx=new.gdx
$if errorlevel 1 $abort problem running with sys17=0

$call gdxdiff old.gdx new.gdx > %system.nullfile%
$if errorlevel 1 $abort "GDX files differ"