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));
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);
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) {}
286 if ((x[0] > 2) || (x[1] > 1))
289 return m(x[0],x[1]) == x[2];
296 element(home, m, x[0], x[1], x[2]);
308 :
Test(
"Element::Matrix::Int::IntVar::XX",2,0,3,false),
317 return m(x[0],x[0]) == x[1];
324 element(home, m, x[0], x[0], x[1]);
336 :
Test(
"Element::Matrix::Int::BoolVar::XY",3,0,3,false),
342 if ((x[0] > 1) || (x[1] > 1))
345 return m(x[0],x[1]) == x[2];
364 :
Test(
"Element::Matrix::Int::BoolVar::XX",2,0,3,false),
373 return m(x[0],x[0]) == x[1];
389 :
Test(
"Element::Matrix::IntVar::IntVar::XY",3+4,0,3,false) {}
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];
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) {}
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];
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) {}
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];
475 :
Test(
"Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
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];
507 for (
int i=0;
i<idx;
i++)
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++) {
MatrixBoolVarBoolVarXY(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntConLevel
Consistency levels for integer propagators.
Test for element with integer array and integer variables
Gecode::IntArgs tm
Array for test matrix.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
const FloatNum max
Largest allowed float value.
Test for matrix element with Boolean variable array and Boolean variable
int size(void) const
Return size of array (number of elements)
VarIntVar(Gecode::IntConLevel icl)
Create and register test.
Test for element with variable array and integer variables
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for matrix element with integer array and integer variable
VarBoolVar(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MatrixIntVarIntVarXY(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
ConTestLevel contest
Whether to test for certain consistency.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MatrixIntIntVarXY(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs c
Array of integers.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
IntIntShared(const std::string &s, const Gecode::IntArgs &c0, int minDomain=-4)
Create and register test.
VarIntShared(Gecode::IntConLevel icl)
Create and register test.
MatrixIntIntVarXX(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for matrix element with integer variable array and integer variable
const FloatNum min
Smallest allowed float value.
void element(Home home, const SetVarArgs &a, IntVar x, int w, IntVar y, int h, SetVar z)
Post propagator for .
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntConLevel icl
Consistency level.
Test for matrix element with integer array and Boolean variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntIntInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
Test for matrix element with integer array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs tm
Array for test matrix.
MatrixIntVarIntVarXX(void)
Create and register test.
MatrixIntBoolVarXX(void)
Create and register test.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
IntIntVar(const std::string &s, const Gecode::IntArgs &c0, int min, int max)
Create and register test.
Test for element with integer array and integer variables
Passing integer variables.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Passing integer arguments.
MatrixBoolVarBoolVarXX(void)
Create and register test.
Passing Boolean variables.
Gecode::IntArgs c
Array of integers.
VarBoolInt(int r0)
Create and register test.
Gecode::IntArgs c
Array of integers.
Test for matrix element with integer array and Boolean variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for element with variable array and integer variables
Gecode::IntArgs c
Array of integers.
Test for element with Boolean variable array and integer variable
Node * x
Pointer to corresponding Boolean expression node.
Test for element with integer array and integer and Boolean variable
Base class for assignments
Gecode::IntArgs c
Array of integers.
Test for matrix element with integer variable array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with variable array and shared integer variable
Test for element with Boolean variable array and integer variable
Help class to create and register tests.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs tm
Array for test matrix.
Matrix-interface for arrays.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Bounds propagation or consistency.
MatrixIntBoolVarXY(void)
Create and register test.
Gecode toplevel namespace
Gecode::IntArgs tm
Array for test matrix.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Create(void)
Perform creation and registration.
Test for element with integer array and single shared integer variable
VarIntInt(Gecode::IntConLevel icl, int r0)
Create and register test.
Test for matrix element with Boolean variable array and Boolean variable
IntBoolVar(const std::string &s, const Gecode::IntArgs &c0)
Create and register test.
int size(void) const
Return size of array (number of elements)
void optimized(int idx, int val)
Test size-dependent optimizations
int size(void) const
Return number of variables.
Test for element with integer array and integer and Boolean variable
Domain propagation or consistency.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntBoolInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution