vardat02.gms : test indexed var/equ data statements

Description

Contributor: Alex Meeraus

  note that the var/equ statement does not create 'l' .. as UELs


Small Model of Type : GAMS


Category : GAMS Test library


Main file : vardat02.gms

$title 'test indexed var/equ data statements' (VARDAT02,SEQ=373)

$onText
Contributor: Alex Meeraus
$offText

$if not gamsversion 227 $exit
* note that the var/equ statement does not create 'l' .. as UELs
set i / 1*3 /, j /a*c/; alias(*,u);
$set data (1,2).a.l 20, 2.a.up 50, 3.a.m 60, 1.(a,c).scale 100, 2.a.lo 0

variable x(i,j) / %data%, 3.a.fx 70 /
* default was set to free
parameter px (i,j,*) / 1*3.a*c.lo -inf, 1*3.a*c.up inf, 1*3.a*c.scale 1  /
* not the zero in %data%
$onMulti
          px (i,j,*) / %data%, 3.a.(l,lo,up) 70 /;
$offMulti
display x.l,x.m,x.lo,x.up,x.scale,px;

abort$sum((i,j), px(i,j,'l')     <> x.l(i,j))     'incorrect .l';
abort$sum((i,j), px(i,j,'m')     <> x.m(i,j))     'incorrect .m';
abort$sum((i,j), px(i,j,'lo')    <> x.lo(i,j))    'incorrect .lo';
abort$sum((i,j), px(i,j,'up')    <> x.up(i,j))    'incorrect .up';
abort$sum((i,j), px(i,j,'scale') <> x.scale(i,j)) 'incorrect .scale';