uldidx03.gms : unloadIdx - checking compilation restrictions

Description

Check basic operation of execute_unloadIdx.  We expect to write only
parameters.  We test here for things that are rejected at compile time.
N.B. Currently you have to run this with action=compile (a=c).
Check for:
  - writing a set: rejected
  - writing a variable: rejected
  - writing a parameter indexed by the universe: rejected
  - writing a parameter indexed by an alias to the universe: rejected

Contributor: Steve Dirkse, Oct 2013


Small Model of Type : GAMS


Category : GAMS Test library


Main file : uldidx03.gms

$title unloadIdx - checking compilation restrictions (uldidx03,SEQ=624)
$onDollar

$onText
Check basic operation of execute_unloadIdx.  We expect to write only
parameters.  We test here for things that are rejected at compile time.
N.B. Currently you have to run this with action=compile (a=c).
Check for:
  - writing a set: rejected
  - writing a variable: rejected
  - writing a parameter indexed by the universe: rejected
  - writing a parameter indexed by an alias to the universe: rejected

Contributor: Steve Dirkse, Oct 2013
$offText


set i / 1 * 10 /;
alias(u,*);
parameter b(i)  / 1 1.5 /;
parameter s1(*) / 2 2.5 /;
parameter s2(u) / 2 2.5 /;


variable x / L 4, M eps /;


execute_unloadIdx 'tmp', b, i;
$if errorfree $abort 'Compiler should reject passing a set to unloadIdx'
$clearError

execute_unloadIdx 'tmp', x;
$if errorfree $abort 'Compiler should reject passing a variable to unloadIdx'
$clearError

execute_unloadIdx 'tmp', s1;
$if errorfree $abort 'Compiler should reject s1(*)'
$clearError

execute_unloadIdx 'tmp', s2;
$if errorfree $abort 'Compiler should reject s2(u), u=universe'
$clearError

* terminate should end compilation and prevent any attempt at execution
$terminate