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(ipl),6,-1,3,false,ipl) {}
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(ipl)+
"::"+
str(r0),
185 5,-1,3,false,ipl), 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(ipl),5,-1,3,false,ipl) {
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++)
298 :
Test(
"Element::Matrix::Int::IntVar::XY",3,0,5,false),
299 tm(6, 0,1,2,3,4,5) {}
304 if ((x[0] > 2) || (x[1] > 1))
307 return m(x[0],x[1]) == x[2];
314 element(home, m, x[0], x[1], x[2]);
326 :
Test(
"Element::Matrix::Int::IntVar::XX",2,0,3,false),
335 return m(x[0],x[0]) == x[1];
342 element(home, m, x[0], x[0], x[1]);
354 :
Test(
"Element::Matrix::Int::BoolVar::XY",3,0,3,false),
360 if ((x[0] > 1) || (x[1] > 1))
363 return m(x[0],x[1]) == x[2];
382 :
Test(
"Element::Matrix::Int::BoolVar::XX",2,0,3,false),
391 return m(x[0],x[0]) == x[1];
407 :
Test(
"Element::Matrix::IntVar::IntVar::XY",3+4,0,3,false) {}
413 if ((x[0] > 1) || (x[1] > 1))
416 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
418 return m(x[0],x[1]) == x[2];
425 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
427 element(home, m, x[0], x[1], x[2]);
436 :
Test(
"Element::Matrix::IntVar::IntVar::XX",2+4,0,3,false) {}
445 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
447 return m(x[0],x[0]) == x[1];
454 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
456 element(home, m, x[0], x[0], x[1]);
465 :
Test(
"Element::Matrix::BoolVar::BoolVar::XY",3+4,0,1,false) {}
472 tm[0]=x[3]; tm[1]=x[4]; tm[2]=x[5]; tm[3]=x[6];
474 return m(x[0],x[1]) == x[2];
493 :
Test(
"Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
500 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
502 return m(x[0],x[0]) == x[1];
525 for (
int i=0;
i<idx;
i++)
537 IntArgs ic2(8, -1,1,-1,1,-1,1,0,0);
539 IntArgs ic4(7, 0,-1,2,-2,4,-3,6);
543 IntArgs bc2(8, 1,1,0,1,0,1,0,0);
554 SCHAR_MAX-1,SCHAR_MAX,
558 for (
int i=0; ov[
i] != 0;
i++)
559 for (
int j=0; ov[j] != 0; j++)
560 optimized(ov[
i],ov[j]);
563 for (
int i=-4;
i<=4;
i++) {
580 for (
int i=0;
i<=1;
i++) {
589 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.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
int size(void) const
Return size of array (number of elements)
Test for element with integer array and integer variables
VarIntShared(Gecode::IntPropLevel ipl)
Create and register test.
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 .
int size(void) const
Return size of array (number of elements)
const FloatNum max
Largest allowed float value.
virtual bool solution(const Assignment &x) const
Test whether x is solution
int size(void) const
Return number of variables.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Test for matrix element with Boolean variable array and Boolean variable
static Gecode::Support::RandomGenerator rand
Random number generator.
Test for element with variable array and integer variables
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.
VarIntInt(Gecode::IntPropLevel ipl, int r0)
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.
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.
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.
IntIntShared(const std::string &s, const Gecode::IntArgs &c0, int minDomain=-4)
Create and register test.
MatrixIntIntVarXX(void)
Create and register test.
Test for matrix element with integer variable array and integer variable
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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.
IntIntInt(const std::string &s, const Gecode::IntArgs &c0, int r0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for matrix element with integer array and integer variable
Gecode::IntArgs tm
Array for test matrix.
MatrixIntVarIntVarXX(void)
Create and register test.
MatrixIntBoolVarXX(void)
Create and register test.
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
Gecode::IntPropLevel ipl
Propagation level.
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.
virtual bool solution(const Assignment &x) const
Test whether x is solution
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.
Boolean integer variables.
Gecode::IntArgs c
Array of integers.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for matrix element with integer array and Boolean variable
IntPropLevel
Propagation levels for integer propagators.
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
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
virtual bool solution(const Assignment &x) const
Test whether x is solution
Base class for assignments
Gecode::IntArgs c
Array of integers.
Test for matrix element with integer variable array and integer variable
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Domain propagation Preferences: prefer speed or memory.
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
virtual bool solution(const Assignment &x) const
Test whether x is solution
Help class to create and register tests.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntArgs tm
Array for test matrix.
Matrix-interface for arrays.
VarIntVar(Gecode::IntPropLevel ipl)
Create and register test.
MatrixIntBoolVarXY(void)
Create and register test.
Gecode toplevel namespace
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.
Create(void)
Perform creation and registration.
Test for element with integer array and single shared integer variable
Test for matrix element with Boolean variable array and Boolean variable
IntBoolVar(const std::string &s, const Gecode::IntArgs &c0)
Create and register test.
void optimized(int idx, int val)
Test size-dependent optimizations
virtual bool solution(const Assignment &x) const
Test whether x is solution
#define GECODE_NEVER
Assert that this command is never executed.
void element(Home home, const SetVarArgs &a, IntVar x, int w, IntVar y, int h, SetVar z)
Test for element with integer array and integer and Boolean variable
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.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
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