Description
In this test we check that the imp function works as expected when the arguments are taken from parameters. CMEX tries to take advantage of sparsity in the inputs when computing outputs, (e.g. with the or operator) but that's not possible with imp: 0 imp 0 = 1. ABMaster issue AB01260: known to fail with 22.4, fixed for 22.5. Contributor: Steve Dirkse
Small Model of Type : GAMS
Category : GAMS Test library
Main file : binary3.gms
$title 'test binary operation: imp' (BINARY3,SEQ=337)
$onText
In this test we check that the imp function works as expected
when the arguments are taken from parameters. CMEX tries to take
advantage of sparsity in the inputs when computing outputs, (e.g. with
the or operator) but that's not possible with imp: 0 imp 0 = 1.
ABMaster issue AB01260: known to fail with 22.4, fixed for 22.5.
Contributor: Steve Dirkse
$offText
set I / 1 * 4 /;
parameters a(I,*), b(I,*);
a(I,'x') = floor((ord(I)-1) / 2);
a(I,'y') = mod(ord(I)-1,2);
a(I,'r') = a(I,'x') imp a(I,'y');
table b(I,*)
x y
1 0 0
2 0 1
3 1 0
4 1 1 ;
b(I,'r') = b(I,'x') imp b(I,'y');
scalar r '0 imp 0';
r = 0 imp 0;
scalar r2 'zero imp zero';
r2 = b('1','x') imp b('1','x');
* these worked fine, i.e. they don't trigger an abort
abort$[not r] ' r: 0 imp 0 returns 0';
abort$[not r2] 'r2: 0 imp 0 returns 0';
* but these are/were a problem!
abort$[not a('1','r')] ' a: 0 imp 0 returns 0';
abort$[not b('1','r')] ' b: 0 imp 0 returns 0';