duplic01.gms : Detecting duplicate entries in unsorted data

Description

Bug: "CMEX accepts duplicates if they come in none-sorted uel order"

For a long time there was a bug, ignoring duplicate entries in data statements
if the data was unsorted. This was fixed with GAMS 25.2.

Contributor: Lutz Westermann, December 2018


Small Model of Type : GAMS


Category : GAMS Test library


Main file : duplic01.gms

$title Detecting duplicate entries in unsorted data (duplic01,SEQ=793)

$ontext
Bug: "CMEX accepts duplicates if they come in none-sorted uel order"

For a long time there was a bug, ignoring duplicate entries in data statements
if the data was unsorted. This was fixed with GAMS 25.2.

Contributor: Lutz Westermann, December 2018
$offtext


$onechoV > mkinc.gms
file fx / inc.gms /; put fx;
scalar i;
for (i=%maxi% downto 1, put i:0:0 /);
putclose '%maxi%';
$offecho

$set maxi 100
$call gams mkinc --maxi=%maxi% lo=%gams.lo%
$ife errorLevel<>0 $abort Problems with mkinc. Check mkinc.lst.


$onechoV > test1.gms
set ii / 1*21 /;
set i(*) /
$include inc.gms
/;
$offecho

$call gams test1 lo=%gams.lo%
$ife errorlevel=0 $abort Problems with test1 (expecting error). Check test1.lst.

$set maxi 50000
$call gams mkinc --maxi=%maxi% lo=%gams.lo%
$ife errorLevel<>0 $abort Problems with mkinc. Check mkinc.lst.

$onechoV > test2.gms
set  ii 'Error' / i1*i20 /;
set i(*) /
$include inc.gms
/;
$offecho
$call gams test2 lo=%gams.lo% pf2=2
$ife errorlevel=0 $abort Problems with test2 (expecting error). Check test2.lst.