81 assert(
x.size() == 2);
125 :
Test(
"Rel::Bool::Var::XY::"+
str(irt0)+
"::"+
str(n),n+1,0,1,
150 assert(
x.size() == 2);
166 :
Test(
"Rel::Bool::Var::XX::"+
str(irt0),1,0,1),
215 assert(
x.size() == 1);
230 :
Test(
"Rel::Bool::Int::"+
str(irt0)+
"::"+
str(n)+
"::"+
str(c0),n,0,1,
254 assert(
x.size() == 1);
276 for (
int i=0; i<
x.size()-1; i++)
281 for (
int i=0; i<
x.size()-1; i++)
309 for (
int i=0; i<
x.size()-1; i++)
315 for (
int i=0; i<2*n-1; i++)
316 if (!
cmp(
x[i % n],
irt,
x[(i+1) % n]))
327 y[i] =
y[n+i] =
x[i];
340 :
Test(
"Rel::Bool::Seq::"+
str(n)+
"::"+
str(irt0),n,0,1),
347 for (
int i=0; i<
x.size()-1; i++)
352 for (
int i=0; i<
x.size()-1; i++)
362 for (
int i=
x.size(); i--; )
376 :
Test(
"Rel::Bool::Seq::Shared::"+
str(n)+
"::"+
str(irt0),n,0,1),
383 for (
int i=0; i<
x.size()-1; i++)
389 for (
int i=0; i<2*n-1; i++)
390 if (!
cmp(
x[i % n],
irt,
x[(i+1) % n]))
414 :
Test(
"Rel::Int::Array::Var::"+
str(irt0),6,-2,2),
irt(irt0) {}
418 for (
int i=0; i<n; i++)
431 for (
int i=0; i<n; i++) {
432 y[i]=
x[i];
z[i]=
x[n+i];
446 :
Test(
"Rel::Int::Array::Int::"+
str(irt0),3,-2,2),
irt(irt0) {}
451 for (
int i=0; i<n; i++)
473 static const int n = 4;
487 for (
int i=0; i<std::min(
n_fst,n_snd); i++)
497 for (
int i=0; i<
n_fst; i++) {
500 for (
int i=0; i<n_snd; i++) {
515 :
Test(
"Rel::Bool::Array::Var::"+
str(irt0),10,0,1),
irt(irt0) {}
519 for (
int i=0; i<n; i++)
532 for (
int i=0; i<n; i++) {
547 :
Test(
"Rel::Bool::Array::Int::"+
str(irt0),5,0,1),
irt(irt0) {}
551 for (
int i=0; i<5; i++)
565 for (
int i=0; i<n; i++)
579 (void)
new IntVarXY(irts.irt(),1,ipls.ipl());
580 (void)
new IntVarXY(irts.irt(),2,ipls.ipl());
581 (void)
new IntVarXX(irts.irt(),ipls.ipl());
582 (void)
new IntSeq(1,irts.irt(),ipls.ipl());
583 (void)
new IntSeq(2,irts.irt(),ipls.ipl());
584 (void)
new IntSeq(3,irts.irt(),ipls.ipl());
585 (void)
new IntSeq(5,irts.irt(),ipls.ipl());
594 (void)
new BoolSeq(1,irts.irt());
595 (void)
new BoolSeq(2,irts.irt());
596 (void)
new BoolSeq(3,irts.irt());
597 (void)
new BoolSeq(10,irts.irt());
603 for (
int c=-4;
c<=4;
c++) {
604 (void)
new IntInt(irts.irt(),1,
c);
605 (void)
new IntInt(irts.irt(),2,
c);
607 for (
int c=0;
c<=1;
c++) {
613 for (
int n_fst=0; n_fst<=4; n_fst++)
Passing Boolean variables.
Boolean integer variables.
Passing integer arguments.
Passing integer variables.
Reification specification.
Base class for assignments
Iterator for simple integer propagation levels.
Iterator for integer relation types.
Test for relation between arrays of Boolean variables and integers
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
BoolArrayInt(Gecode::IntRelType irt0)
Create and register test.
Test for relation between arrays of 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
Gecode::IntRelType irt
Integer relation type to propagate.
BoolArrayVar(Gecode::IntRelType irt0)
Create and register test.
Test for simple relation involving Boolean variable and integer constant
virtual bool solution(const Assignment &x) const
Test whether x is solution
BoolInt(Gecode::IntRelType irt0, int n, int c0)
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.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for sequence of relations between Boolean variables
BoolSeq(int n, Gecode::IntRelType irt0)
Create and register test.
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
Test for sequence of relations between shared Boolean variables
Gecode::IntRelType irt
Integer relation type to propagate.
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.
Test for simple relation involving shared Boolean variables
BoolVarXX(Gecode::IntRelType irt0)
Create and register test.
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.
Test for simple relation involving Boolean variables
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
BoolVarXY(Gecode::IntRelType irt0, int n)
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, Gecode::Reify r)
Post reified constraint on x for r.
Help class to create and register tests.
Create(void)
Perform creation and registration.
Test for relation between differently sized arrays of integer variables
virtual bool solution(const Assignment &x) const
Test whether x is solution
static const int n
How many variables in total.
IntArrayDiff(Gecode::IntRelType irt0, int m)
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.
int n_fst
How big is the first array.
Test for relation between same sized arrays of integer variables and integers
Gecode::IntRelType irt
Integer relation type to propagate.
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.
IntArrayInt(Gecode::IntRelType irt0)
Create and register test.
Test for relation between same sized arrays of integer variables
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
IntArrayVar(Gecode::IntRelType irt0)
Create and register test.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for simple relation involving integer variable and integer constant
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.
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
IntInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
Test for sequence of relations between integer variables
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Test for sequence of relations between shared integer variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntRelType irt
Integer relation type to propagate.
virtual bool solution(const Assignment &x) const
Test whether x is solution
IntSharedSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Test for simple relation involving shared integer variables
IntVarXX(Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
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, Gecode::Reify r)
Post reified constraint on x for r.
virtual bool solution(const Assignment &x) const
Test whether x is solution
Test for simple relation involving integer variables
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Gecode::IntRelType irt
Integer relation type to propagate.
IntVarXY(Gecode::IntRelType irt0, int n, Gecode::IntPropLevel ipl)
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, Gecode::Reify r)
Post reified constraint on x for r.
Gecode::IntPropLevel ipl
Propagation level.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
ConTestLevel contest
Whether to test for certain consistency.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
IntRelType
Relation types for integers.
IntPropLevel
Propagation levels for integer propagators.
@ IRT_GQ
Greater or equal ( )
@ IRT_LQ
Less or equal ( )
Gecode toplevel namespace
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
Post propagator for SetVar x
Tests for relation constraints
Testing finite domain integers.
@ CTL_NONE
No consistency-test.
@ CTL_DOMAIN
Test for domain-consistency.
#define GECODE_NEVER
Assert that this command is never executed.