43 namespace Test {
namespace Int {
62 :
Test(
"Element::Int::Int::Var::"+s,2,min,max),
66 return (x[0]>= 0) && (x[0]<
c.
size()) &&
c[x[0]]==x[1];
84 :
Test(
"Element::Int::Int::Int::"+s+
"::"+
str(r0),1,-4,8),
88 return (x[0]>= 0) && (x[0]<
c.
size()) &&
c[x[0]]==
r;
105 :
Test(
"Element::Int::Int::Shared::"+s,1,minDomain,8),
c(c0) {}
108 return (x[0]>= 0) && (x[0]<
c.
size()) &&
c[x[0]]==x[0];
124 :
Test(
"Element::Int::Bool::Var::"+s,2,-4,8),
c(c0) {}
127 return (x[0]>= 0) && (x[0]<
c.
size()) &&
c[x[0]]==x[1];
145 :
Test(
"Element::Int::Bool::Int::"+s+
"::"+
str(r0),1,-4,8),
149 return (x[0]>= 0) && (x[0]<
c.
size()) &&
c[x[0]]==
r;
162 :
Test(
"Element::Var::Int::Var::"+
str(icl),6,-1,3,false,icl) {}
165 return (x[0]>= 0) && (x[0]<x.
size()-2) && x[2+x[0]]==x[1];
170 for (
int i=0;
i<x.
size()-2;
i++)
184 :
Test(
"Element::Var::Int::Int::"+
str(icl)+
"::"+
str(r0),
185 5,-1,3,false,icl),
r(r0) {
190 return (x[0]>= 0) && (x[0]<x.
size()-1) && x[1+x[0]]==
r;
195 for (
int i=0;
i<x.
size()-1;
i++)
206 :
Test(
"Element::Var::Int::Shared::"+
str(icl),5,-1,3,false,icl) {
211 return (x[0]>= 0) && (x[0]<x.
size()-1) && x[1+x[0]]==x[0];
216 for (
int i=0;
i<x.
size()-1;
i++)
229 for (
int i=0;
i<x.
size()-2;
i++)
230 if ((x[2+
i] < 0) || (x[2+
i]>1))
232 return ((x[0]>= 0) && (x[0]<x.
size()-2) && x[2+x[0]]==x[1]
233 && (x[1]>=0) && (x[1]<=1));
237 using namespace Gecode;
239 for (
int i=0;
i<x.
size()-2;
i++)
253 :
Test(
"Element::Var::Bool::Int::"+
str(r0),5,-1,3,false),
r(r0) {}
256 for (
int i=0;
i<x.
size()-1;
i++)
257 if ((x[1+
i] < 0) || (x[1+
i]>1))
259 return ((x[0]>= 0) && (x[0]<x.
size()-1) && x[1+x[0]]==
r);
263 using namespace Gecode;
265 for (
int i=0;
i<x.
size()-1;
i++)
280 :
Test(
"Element::Matrix::Int::IntVar::XY",3,0,5,false),
281 tm(6, 0,1,2,3,4,5) {}
285 using namespace Gecode;
286 if ((x[0] > 2) || (x[1] > 1))
289 return m(x[0],x[1]) == x[2];
294 using namespace Gecode;
296 element(home, m, x[0], x[1], x[2]);
308 :
Test(
"Element::Matrix::Int::IntVar::XX",2,0,3,false),
313 using namespace Gecode;
317 return m(x[0],x[0]) == x[1];
322 using namespace Gecode;
324 element(home, m, x[0], x[0], x[1]);
336 :
Test(
"Element::Matrix::Int::BoolVar::XY",3,0,3,false),
341 using namespace Gecode;
342 if ((x[0] > 1) || (x[1] > 1))
345 return m(x[0],x[1]) == x[2];
350 using namespace Gecode;
364 :
Test(
"Element::Matrix::Int::BoolVar::XX",2,0,3,false),
369 using namespace Gecode;
373 return m(x[0],x[0]) == x[1];
378 using namespace Gecode;
389 :
Test(
"Element::Matrix::IntVar::IntVar::XY",3+4,0,3,false) {}
394 using namespace Gecode;
395 if ((x[0] > 1) || (x[1] > 1))
398 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
400 return m(x[0],x[1]) == x[2];
405 using namespace Gecode;
407 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
409 element(home, m, x[0], x[1], x[2]);
418 :
Test(
"Element::Matrix::IntVar::IntVar::XX",2+4,0,3,false) {}
423 using namespace Gecode;
427 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
429 return m(x[0],x[0]) == x[1];
434 using namespace Gecode;
436 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
438 element(home, m, x[0], x[0], x[1]);
447 :
Test(
"Element::Matrix::BoolVar::BoolVar::XY",3+4,0,1,false) {}
452 using namespace Gecode;
454 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
456 return m(x[0],x[1]) == x[2];
461 using namespace Gecode;
475 :
Test(
"Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
480 using namespace Gecode;
482 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
484 return m(x[0],x[0]) == x[1];
489 using namespace Gecode;
507 for (
int i=0;
i<idx;
i++)
517 using namespace Gecode;
519 IntArgs ic2(8, -1,1,-1,1,-1,1,0,0);
521 IntArgs ic4(7, 0,-1,2,-2,4,-3,6);
525 IntArgs bc2(8, 1,1,0,1,0,1,0,0);
536 SCHAR_MAX-1,SCHAR_MAX,
540 for (
int i=0; ov[
i] != 0;
i++)
541 for (
int j=0; ov[j] != 0; j++)
542 optimized(ov[
i],ov[j]);
545 for (
int i=-4;
i<=4;
i++) {
562 for (
int i=0;
i<=1;
i++) {
571 for (
int i=-4;
i<=4;
i++) {