uldidx01.gms : unloadIdx - basic operation

Description

Check basic operation of execute_unloadIdx: writing parameter data
indexed in the simplest way possible: 1..n_{i}, i=1..symDim

Contributor: Steve Dirkse, Oct 2013


Small Model of Type : GAMS


Category : GAMS Test library


Main file : uldidx01.gms

$title unloadIdx - basic operation (uldidx01,SEQ=622)

$onText
Check basic operation of execute_unloadIdx: writing parameter data
indexed in the simplest way possible: 1..n_{i}, i=1..symDim

Contributor: Steve Dirkse, Oct 2013
$offText

sets
  i  / 1 * 3 /
  j  / 1 * 5 /
  k  / 1 * 2 /
  ;
alias(k,k3,k4,k5,k6,k7,k8,k9,k10);
scalar a0  / 525 /;
parameters
  a1(j) / (1,3,5) 2 /
  a2(k,k) / (#k).(#k) 50 /
  a3(i,j,k) / 2.(1,3,5).(#k) 3 /
  a10(i,j,k,k4,k5,k6,k7,k8,k9,k10)
  ;
a10('3','3',k3,k4,k5,k6,k7,k8,k9,k10) = 5;

execute 'rm -f  idx0.gdx idx1.gdx';

execute_unloadIdx 'idx0';
execute 'gdxdiff idx0.gdx idx0_.gdx > %system.nullfile%';
abort$errorlevel 'idx0 file did not have expected content';

execute_unloadIdx 'idx1', a0, a1, a2, a3, a10;
execute 'gdxdiff idx1.gdx idx1_.gdx > %system.nullfile%';
abort$errorlevel 'idx1 file did not have expected content';
execute 'gdxdump idx1.gdx domainInfo > idx1.txt';
execute 'diff idx1.txt idx1_.txt > idx1.diff';
abort$errorlevel 'idx1 domainInfo not as expected: check idx1.diff';

execute 'rm -f idx0.gdx idx1.gdx idx1.txt idx1.diff diffile.gdx'