Description
Generate data for testing the GDXMRW function rgdx Contributor: Steve
Small Model of Type : GAMS
Category : GAMS Test library
Main file : gen_rbig.gms
$TITLE Generate GDX file for test of GDXMRW (GEN_RBIG,SEQ=485)
$ontext
Generate data for testing the GDXMRW function rgdx
Contributor: Steve
$offtext
sets
I / 1 * 3 /
p1(I) / 2 /
s0 / 0, 1 /
s1 / zero, one /
s2 / null, eins /
s3 / aught, unity /
sx / x0, x1 /
s9 / cero, uno /
ps10(s0,s1,s2,s3,sx,sx,sx,sx,sx,s9) 'power set for 10 elements'
tiny(s0,s1,s2,s3,sx,sx,sx,sx,sx,s9) 'tiny subset of power set' /
'1'.'one'.'eins'.'unity'.'x1'.'x1'.'x1'.'x1'.'x1'.'uno' yes
/
ps4(s0,s1,s2,s3) 'power set for 4 elements'
;
parameter
a10(s0,s1,s2,s3,sx,sx,sx,sx,sx,s9) 'like the power set for 10 elements'
atiny(s0,s1,s2,s3,sx,sx,sx,sx,sx,s9) 'single tuple' /
'1'.'one'.'eins'.'unity'.'x1'.'x1'.'x1'.'x1'.'x1'.'uno' 525
/
a4(s0,s1,s2,s3) 'like the power set for 4 elements'
;
alias(sx,s4,s5,s6,s7,s8);
ps10(s0,s1,s2,s3,s4,s5,s6,s7,s8,s9) = yes;
ps4 (s0,s1,s2,s3) = yes;
a10(s0,s1,s2,s3,s4,s5,s6,s7,s8,s9) =
s0.val * 1
+ (ord(s1)-1) * 2
+ (ord(s2)-1) * 4
+ (ord(s3)-1) * 8
+ (ord(s4)-1) * 16
+ (ord(s5)-1) * 32
+ (ord(s6)-1) * 64
+ (ord(s7)-1) * 128
+ (ord(s8)-1) * 256
+ (ord(s9)-1) * 512
;
a4 (s0,s1,s2,s3) =
s0.val * 1
+ (ord(s1)-1) * 2
+ (ord(s2)-1) * 4
+ (ord(s3)-1) * 8
;
execute_unload 'readbig', I, p1,
s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,sx
ps10, tiny, ps4
a10, atiny, a4
;
* test correctness with readFull.m and readSparse.m