58 :
Test(
"Element::Int::Int::Var::"+s,2,min,max),
62 return (x[0]>= 0) && (x[0]<
c.size()) &&
c[x[0]]==x[1];
80 :
Test(
"Element::Int::Int::Int::"+s+
"::"+
str(r0),1,-4,8),
84 return (x[0]>= 0) && (x[0]<
c.size()) &&
c[x[0]]==
r;
101 :
Test(
"Element::Int::Int::Shared::"+s,1,minDomain,8),
c(c0) {}
104 return (x[0]>= 0) && (x[0]<
c.size()) &&
c[x[0]]==x[0];
120 :
Test(
"Element::Int::Bool::Var::"+s,2,-4,8),
c(c0) {}
123 return (x[0]>= 0) && (x[0]<
c.size()) &&
c[x[0]]==x[1];
141 :
Test(
"Element::Int::Bool::Int::"+s+
"::"+
str(r0),1,-4,8),
145 return (x[0]>= 0) && (x[0]<
c.size()) &&
c[x[0]]==
r;
158 :
Test(
"Element::Var::Int::Var::"+
str(
ipl),6,-1,3,false,
ipl) {}
161 return (x[0]>= 0) && (x[0]<x.size()-2) && x[2+x[0]]==x[1];
166 for (
int i=0; i<x.size()-2; i++)
181 5,-1,3,false,
ipl),
r(r0) {
186 return (x[0]>= 0) && (x[0]<x.size()-1) && x[1+x[0]]==
r;
191 for (
int i=0; i<x.size()-1; i++)
202 :
Test(
"Element::Var::Int::Shared::"+
str(
ipl),5,-1,3,false,
ipl) {
207 return (x[0]>= 0) && (x[0]<x.size()-1) && x[1+x[0]]==x[0];
212 for (
int i=0; i<x.size()-1; i++)
225 for (
int i=0; i<x.size()-2; i++)
226 if ((x[2+i] < 0) || (x[2+i]>1))
228 return ((x[0]>= 0) && (x[0]<x.size()-2) && x[2+x[0]]==x[1]
229 && (x[1]>=0) && (x[1]<=1));
235 for (
int i=0; i<
x.size()-2; i++)
249 :
Test(
"Element::Var::Bool::Int::"+
str(r0),5,-1,3,false),
r(r0) {}
252 for (
int i=0; i<
x.size()-1; i++)
253 if ((
x[1+i] < 0) || (
x[1+i]>1))
255 return ((
x[0]>= 0) && (
x[0]<
x.size()-1) &&
x[1+
x[0]]==
r);
261 for (
int i=0; i<
x.size()-1; i++)
294 :
Test(
"Element::Matrix::Int::IntVar::XY",3,0,5,false),
300 if ((
x[0] > 2) || (
x[1] > 1))
303 return m(
x[0],
x[1]) ==
x[2];
322 :
Test(
"Element::Matrix::Int::IntVar::XX",2,0,3,false),
331 return m(
x[0],
x[0]) ==
x[1];
350 :
Test(
"Element::Matrix::Int::BoolVar::XY",3,0,3,false),
356 if ((
x[0] > 1) || (
x[1] > 1))
359 return m(
x[0],
x[1]) ==
x[2];
378 :
Test(
"Element::Matrix::Int::BoolVar::XX",2,0,3,false),
387 return m(
x[0],
x[0]) ==
x[1];
403 :
Test(
"Element::Matrix::IntVar::IntVar::XY",3+4,0,3,false) {}
409 if ((
x[0] > 1) || (
x[1] > 1))
412 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
414 return m(
x[0],
x[1]) ==
x[2];
421 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
432 :
Test(
"Element::Matrix::IntVar::IntVar::XX",2+4,0,3,false) {}
441 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
443 return m(
x[0],
x[0]) ==
x[1];
450 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
461 :
Test(
"Element::Matrix::BoolVar::BoolVar::XY",3+4,0,1,false) {}
468 tm[0]=
x[3]; tm[1]=
x[4]; tm[2]=
x[5]; tm[3]=
x[6];
470 return m(
x[0],
x[1]) ==
x[2];
489 :
Test(
"Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
496 tm[0]=
x[2]; tm[1]=
x[3]; tm[2]=
x[4]; tm[3]=
x[5];
498 return m(
x[0],
x[0]) ==
x[1];
521 for (
int i=0; i<idx; i++)
522 c[i]=std::max(val-i,0);
533 IntArgs ic2({-1,1,-1,1,-1,1,0,0});
535 IntArgs ic4({0,-1,2,-2,4,-3,6});
539 IntArgs bc2({1,1,0,1,0,1,0,0});
550 SCHAR_MAX-1,SCHAR_MAX,
554 for (
int i=0; ov[i] != 0; i++)
555 for (
int j=0; ov[j] != 0; j++)
559 for (
int i=-4; i<=4; i++) {
576 for (
int i=0; i<=1; i++) {
585 for (
int i=-4; i<=4; i++) {
Passing Boolean variables.
Boolean integer variables.
Passing integer arguments.
Passing integer variables.
Matrix-interface for arrays.
static Gecode::Support::RandomGenerator rand
Random number generator.
Base class for assignments
Help class to create and register tests.
void optimized(int idx, int val)
Test size-dependent optimizations
Create(void)
Perform creation and registration.
Test for element with integer array and integer and Boolean variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs c
Array of integers.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntBoolInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
Test for element with integer array and integer and Boolean variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs c
Array of integers.
IntBoolVar(const std::string &s, const Gecode::IntArgs &c0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for element with integer array and integer variables
IntIntInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
Gecode::IntArgs c
Array of integers.
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 integer array and single shared integer variable
Gecode::IntArgs c
Array of integers.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntIntShared(const std::string &s, const Gecode::IntArgs &c0, int minDomain=-4)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for element with integer array and integer variables
Gecode::IntArgs c
Array of integers.
IntIntVar(const std::string &s, const Gecode::IntArgs &c0, int min, int max)
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.
Test for matrix element with Boolean variable array and Boolean variable
MatrixBoolVarBoolVarXX(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.
Test for matrix element with Boolean variable array and Boolean variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MatrixBoolVarBoolVarXY(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for matrix element with integer array and Boolean variable
MatrixIntBoolVarXX(void)
Create and register test.
Gecode::IntArgs tm
Array for test matrix.
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 matrix element with integer array and Boolean variable
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
MatrixIntBoolVarXY(void)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntArgs tm
Array for test matrix.
Test for matrix element with integer array and integer variable
Gecode::IntArgs tm
Array for test matrix.
virtual bool solution(const Assignment &x) const
Test whether x is solution
MatrixIntIntVarXX(void)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for matrix element with integer array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
MatrixIntIntVarXY(void)
Create and register test.
Gecode::IntArgs tm
Array for test matrix.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for matrix element with integer variable array and integer variable
MatrixIntVarIntVarXX(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.
Test for matrix element with integer variable array and integer variable
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
MatrixIntVarIntVarXY(void)
Create and register test.
Test for element with Boolean variable array and integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
VarBoolInt(int r0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with Boolean variable array and integer variable
VarBoolVar(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
Test for element with variable array and integer variables
virtual bool solution(const Assignment &x) const
Test whether x is solution
VarIntInt(Gecode::IntPropLevel ipl, int r0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with variable array and shared integer variable
virtual bool solution(const Assignment &x) const
Test whether x is solution
VarIntShared(Gecode::IntPropLevel ipl)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for element with variable array and integer variables
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
VarIntVar(Gecode::IntPropLevel ipl)
Create and register test.
Gecode::IntPropLevel ipl
Propagation level.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
ConTestLevel contest
Whether to test for certain consistency.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
IntPropLevel
Propagation levels for integer propagators.
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
@ IPL_BND
Bounds propagation.
Gecode toplevel namespace
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Post propagator for SetVar x
Tests for element constraints
Testing finite domain integers.
@ CTL_NONE
No consistency-test.
#define GECODE_NEVER
Assert that this command is never executed.