42 namespace Test {
namespace Int {
60 :
Test(
"Rel::Int::Var::XY::"+
str(irt0)+
"::"+
str(icl)+
"::"+
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],
icl);
79 rel(home, y, irt, x[2],
icl);
85 assert(x.
size() == 2);
98 :
Test(
"Rel::Int::Var::XX::"+
str(irt0)+
"::"+
str(icl),
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(icl),
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(icl),
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::"+
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);
448 static const int n = 4;
454 :
Test(
"Rel::Int::Array::"+
str(irt0)+
"::"+
str(m)+
"::"+
str(n-m),
456 irt(irt0), n_fst(m) {
461 int n_snd = n - n_fst;
463 if (x[
i] != x[n_fst+
i])
464 return cmp(x[
i],irt,x[n_fst+i]);
465 return cmp(n_fst,irt,n_snd);
470 int n_snd = n - n_fst;
472 for (
int i=0;
i<n_fst;
i++) {
475 for (
int i=0;
i<n_snd;
i++) {
478 rel(home, y, irt, z);
490 :
Test(
"Rel::Bool::Array::"+
str(irt0),10,0,1), irt(irt0) {}
494 for (
int i=0;
i<
n;
i++)
496 return cmp(x[
i],irt,x[n+i]);
507 for (
int i=0;
i<
n;
i++) {
510 rel(home, y, irt, z);
522 (void)
new IntVarXY(irts.irt(),1,icls.icl());
523 (void)
new IntVarXY(irts.irt(),2,icls.icl());
524 (void)
new IntVarXX(irts.irt(),icls.icl());
525 (void)
new IntSeq(1,irts.irt(),icls.icl());
526 (void)
new IntSeq(2,irts.irt(),icls.icl());
527 (void)
new IntSeq(3,irts.irt(),icls.icl());
528 (void)
new IntSeq(5,irts.irt(),icls.icl());
537 (void)
new BoolSeq(1,irts.irt());
538 (void)
new BoolSeq(2,irts.irt());
539 (void)
new BoolSeq(3,irts.irt());
540 (void)
new BoolSeq(10,irts.irt());
546 for (
int c=-4;
c<=4;
c++) {
547 (void)
new IntInt(irts.irt(),1,
c);
548 (void)
new IntInt(irts.irt(),2,
c);
550 for (
int c=0;
c<=1;
c++) {
555 for (
int n_fst=0; n_fst<=4; n_fst++)
Test for relation between same sized arrays of integer variables
Test for relation between arrays of Boolean variables
Test for relation between differently sized arrays of integer variables
BoolVarXY(Gecode::IntRelType irt0, int n)
Create and register test.
BoolVarXX(Gecode::IntRelType irt0)
Create and register test.
IntSharedSeq(int n, Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
IntConLevel
Consistency levels for integer propagators.
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 .
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
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
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
Gecode::IntRelType irt
Integer relation type to propagate.
Help class to create and register tests.
IntVarXX(Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
Create(void)
Perform creation and registration.
Iterator for integer consistency levels.
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.
ConTestLevel contest
Whether to test for certain consistency.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
IntInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
virtual bool solution(const Assignment &x) const
Test whether x is solution
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.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
Test for sequence of relations between shared Boolean 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
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.
Gecode::IntConLevel icl
Consistency level.
void rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r)
Post propagator for .
IntRelType
Relation types for integers.
IntArray(Gecode::IntRelType irt0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Gecode::IntRelType irt
Integer relation type to propagate.
Gecode::IntRelType irt
Integer relation type to propagate.
Iterator for integer relation types.
Test for simple relation involving shared integer variables
virtual bool solution(const Assignment &x) const
Test whether x is solution
Reification specification.
Gecode::IntRelType irt
Integer relation type to propagate.
Test for simple relation involving shared Boolean variables
Test for simple relation involving Boolean variable and integer constant
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for domain-consistency.
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 void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Passing integer variables.
Passing Boolean variables.
Test for sequence of relations between shared integer variables
Gecode::IntRelType irt
Integer relation type to propagate.
Boolean integer variables.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
IntSeq(int n, Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
Node * x
Pointer to corresponding Boolean expression node.
Test for sequence of relations between Boolean variables
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
Test for simple relation involving Boolean variables
BoolArray(Gecode::IntRelType irt0)
Create and register test.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
virtual bool solution(const Assignment &x) const
Test whether x is solution
Gecode::IntRelType irt
Integer relation type to propagate.
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
IntVarXY(Gecode::IntRelType irt0, int n, Gecode::IntConLevel icl)
Create and register test.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
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.
int size(void) const
Return size of array (number of elements)
virtual bool solution(const Assignment &x) const
Test whether x is solution
#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.
Test for sequence of relations between integer variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
int size(void) const
Return number of variables.
IntArrayDiff(Gecode::IntRelType irt0, int m)
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, Gecode::Reify r)
Post reified constraint on x for r.