42 namespace Test {
namespace Int {
60 :
Test(
"Rel::Int::Var::XY::"+
str(irt0)+
"::"+
str(ipl)+
"::"+
str(n),
66 return cmp(x[0],irt,x[1]);
68 return cmp(x[0],irt,x[2]) &&
cmp(x[1],irt,x[2]);
75 rel(home, x[0], irt, x[1],
ipl);
79 rel(home, y, irt, x[2],
ipl);
85 assert(x.
size() == 2);
98 :
Test(
"Rel::Int::Var::XX::"+
str(irt0)+
"::"+
str(ipl),
108 return cmp(x[0],irt,x[0]);
129 :
Test(
"Rel::Bool::Var::XY::"+
str(irt0)+
"::"+
str(n),n+1,0,1,
135 return cmp(x[0],irt,x[1]);
137 return cmp(x[0],irt,x[2]) &&
cmp(x[1],irt,x[2]);
154 assert(x.
size() == 2);
170 :
Test(
"Rel::Bool::Var::XX::"+
str(irt0),1,0,1),
179 return cmp(x[0],irt,x[0]);
204 return cmp(x[0],irt,c);
206 return cmp(x[0],irt,c) &&
cmp(x[1],irt,c);
212 rel(home, x[0], irt, c);
214 rel(home, x, irt, c);
219 assert(x.
size() == 1);
234 :
Test(
"Rel::Bool::Int::"+
str(irt0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1,
240 return cmp(x[0],irt,c);
242 return cmp(x[0],irt,c) &&
cmp(x[1],irt,c);
252 rel(home, y, irt, c);
258 assert(x.
size() == 1);
272 :
Test(
"Rel::Int::Seq::"+
str(n)+
"::"+
str(irt0)+
"::"+
str(ipl),
280 for (
int i=0;
i<x.
size()-1;
i++)
285 for (
int i=0;
i<x.
size()-1;
i++)
286 if (!
cmp(x[
i],irt,x[i+1]))
305 :
Test(
"Rel::Int::Seq::Shared::"+
str(n)+
"::"+
str(irt0)+
"::"+
str(ipl),
313 for (
int i=0;
i<x.
size()-1;
i++)
319 for (
int i=0;
i<2*n-1;
i++)
320 if (!
cmp(x[
i % n],irt,x[(
i+1) % n]))
331 y[
i] = y[n+
i] = x[
i];
344 :
Test(
"Rel::Bool::Seq::"+
str(n)+
"::"+
str(irt0),n,0,1),
351 for (
int i=0;
i<x.
size()-1;
i++)
356 for (
int i=0;
i<x.
size()-1;
i++)
357 if (!
cmp(x[
i],irt,x[i+1]))
366 for (
int i=x.
size();
i--; )
380 :
Test(
"Rel::Bool::Seq::Shared::"+
str(n)+
"::"+
str(irt0),n,0,1),
387 for (
int i=0;
i<x.
size()-1;
i++)
393 for (
int i=0;
i<2*n-1;
i++)
394 if (!
cmp(x[
i % n],irt,x[(
i+1) % n]))
418 :
Test(
"Rel::Int::Array::Var::"+
str(irt0),6,-2,2), irt(irt0) {}
422 for (
int i=0;
i<
n;
i++)
424 return cmp(x[
i],irt,x[n+i]);
435 for (
int i=0;
i<
n;
i++) {
436 y[
i]=x[
i]; z[
i]=x[n+
i];
438 rel(home, y, irt, z);
450 :
Test(
"Rel::Int::Array::Int::"+
str(irt0),3,-2,2), irt(irt0) {}
455 for (
int i=0;
i<
n;
i++)
457 return cmp(x[i],irt,y[i]);
467 rel(home, x, irt, y);
477 static const int n = 4;
483 :
Test(
"Rel::Int::Array::"+
str(irt0)+
"::"+
str(m)+
"::"+
str(n-m),
485 irt(irt0), n_fst(m) {
490 int n_snd = n - n_fst;
492 if (x[
i] != x[n_fst+
i])
493 return cmp(x[
i],irt,x[n_fst+i]);
494 return cmp(n_fst,irt,n_snd);
499 int n_snd = n - n_fst;
501 for (
int i=0;
i<n_fst;
i++) {
504 for (
int i=0;
i<n_snd;
i++) {
507 rel(home, y, irt, z);
519 :
Test(
"Rel::Bool::Array::Var::"+
str(irt0),10,0,1), irt(irt0) {}
523 for (
int i=0;
i<
n;
i++)
525 return cmp(x[
i],irt,x[n+i]);
536 for (
int i=0;
i<
n;
i++) {
539 rel(home, y, irt, z);
551 :
Test(
"Rel::Bool::Array::Int::"+
str(irt0),5,0,1), irt(irt0) {}
555 for (
int i=0;
i<5;
i++)
557 return cmp(x[i],irt,y[i]);
569 for (
int i=0;
i<
n;
i++)
571 rel(home, y, irt, z);
583 (void)
new IntVarXY(irts.irt(),1,ipls.ipl());
584 (void)
new IntVarXY(irts.irt(),2,ipls.ipl());
585 (void)
new IntVarXX(irts.irt(),ipls.ipl());
586 (void)
new IntSeq(1,irts.irt(),ipls.ipl());
587 (void)
new IntSeq(2,irts.irt(),ipls.ipl());
588 (void)
new IntSeq(3,irts.irt(),ipls.ipl());
589 (void)
new IntSeq(5,irts.irt(),ipls.ipl());
598 (void)
new BoolSeq(1,irts.irt());
599 (void)
new BoolSeq(2,irts.irt());
600 (void)
new BoolSeq(3,irts.irt());
601 (void)
new BoolSeq(10,irts.irt());
607 for (
int c=-4;
c<=4;
c++) {
608 (void)
new IntInt(irts.irt(),1,
c);
609 (void)
new IntInt(irts.irt(),2,
c);
611 for (
int c=0;
c<=1;
c++) {
617 for (
int n_fst=0; n_fst<=4; n_fst++)
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for relation between differently sized arrays of integer variables
IntVarXY(Gecode::IntRelType irt0, int n, Gecode::IntPropLevel ipl)
Create and register test.
BoolVarXY(Gecode::IntRelType irt0, int n)
Create and register test.
BoolVarXX(Gecode::IntRelType irt0)
Create and register test.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
BoolArrayInt(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
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)
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int size(void) const
Return number of variables.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
BoolArrayVar(Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Help class to create and register tests.
IntVarXX(Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Test for relation between arrays of Boolean variables
Create(void)
Perform creation and registration.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
BoolSeq(int n, Gecode::IntRelType irt0)
Create and register test.
Test for simple relation involving integer variables
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
ConTestLevel contest
Whether to test for certain consistency.
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
IntInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
BoolSharedSeq(int n, Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntRelType irt
Integer relation type to propagate.
Test for relation between same sized arrays of integer variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for sequence of relations between shared Boolean variables
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.
IntSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
void rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r)
Post propagator for .
IntRelType
Relation types for integers.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
IntArrayInt(Gecode::IntRelType irt0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
Iterator for integer relation types.
Gecode::IntRelType irt
Integer relation type to propagate.
Test for simple relation involving shared integer variables
Reification specification.
Gecode::IntRelType irt
Integer relation type to propagate.
Test for simple relation involving shared Boolean variables
Gecode::IntRelType irt
Integer relation type to propagate.
Test for simple relation involving Boolean variable and integer constant
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 domain-consistency.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
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.
int n_fst
How big is the first array.
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.
Gecode::IntPropLevel ipl
Propagation level.
Passing integer variables.
Passing integer arguments.
Passing Boolean variables.
Test for sequence of relations between shared integer variables
Test for relation between same sized arrays of integer variables and integers
Gecode::IntRelType irt
Integer relation type to propagate.
Boolean integer variables.
Gecode::IntRelType irt
Integer relation type to propagate.
IntPropLevel
Propagation levels for integer propagators.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
Post propagator for SetVar SetOpType SetVar y
Node * x
Pointer to corresponding Boolean expression node.
Test for sequence of relations between Boolean variables
Base class for assignments
Test for simple relation involving Boolean variables
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntArrayVar(Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntSharedSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Test for relation between arrays of Boolean variables and integers
Gecode toplevel namespace
Test for simple relation involving integer variable and integer constant
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
#define GECODE_NEVER
Assert that this command is never executed.
BoolInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
Test for sequence of relations between integer variables
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
IntArrayDiff(Gecode::IntRelType irt0, int m)
Create and register test.
Iterator for simple integer propagation levels.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
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