42 namespace Test {
namespace Set {
53 static const int d1r[4][2] = {
54 {-4,-3},{-1,-1},{1,1},{3,5}
58 static const int d1cr[5][2] = {
67 static const int d2r[2][2] = {
70 static IntSet ds_33c(d2r,2);
86 static bool in(
int i, I&
c,
bool eq=
false) {
102 SetTest(
"Dom::Range::"+str(srt0)+
"::"+str(n),n,ds_33,(n == 1)),
106 for (
int i=x.
size();
i--; ) {
115 if (!((!xr()) || in(minSymDiff(x,i,is),dr,
true)))
119 if (!(xr() ? in(minSymDiff(x,i,is),dr) : dr()))
123 if (!((!dr()) || in(minSymDiff(x,i,is),xr,
true)))
127 if (!(dr() ? in(minSymDiff(x,i,is),xr) : xr()))
170 assert(x.
size() == 1);
182 :
SetTest(
"Dom::IntRange::"+str(srt0)+
"::"+str(n),1,ds_33,n==1),
186 for (
int i=x.
size();
i--; ) {
196 if (!((!xr()) || in(minSymDiff(x,i,is),dr,
true)))
200 if (!(xr() ? in(minSymDiff(x,i,is),dr) : dr()))
204 if (!((!dr()) || in(minSymDiff(x,i,is),xr,
true)))
208 if (!(dr() ? in(minSymDiff(x,i,is),xr) : xr()))
251 assert(x.
size() == 1);
263 SetTest(
"Dom::Int::"+str(srt0)+
"::"+str(n),n,ds_33,n==1),
268 for (
int i=x.
size();
i--; ) {
277 if (!((!xr()) || in(minSymDiff(x,i,is),dr,
true)))
281 if (!(xr() ? in(minSymDiff(x,i,is),dr) : dr()))
285 if (!((!dr()) || in(minSymDiff(x,i,is),xr,
true)))
289 if (!(dr() ? in(minSymDiff(x,i,is),xr) : xr()))
334 assert(x.
size() == 1);
347 SetTest(
"Dom::Dom::"+str(srt0)+
"::"+str(n),n,d1,(n == 1)),
351 for (
int i=x.
size();
i--; ) {
360 if (!((!xr()) || in(minSymDiff(x,i,is),dr,
true)))
364 if (!(xr() ? in(minSymDiff(x,i,is),dr) : dr()))
368 if (!((!dr()) || in(minSymDiff(x,i,is),xr,
true)))
372 if (!(dr() ? in(minSymDiff(x,i,is),xr) : xr()))
415 assert(x.
size() == 1);
425 :
SetTest(
"Dom::CardRange::"+str(n),n,d1,false) {}
428 for (
int i=x.
size();
i--; ) {
431 if ((card < 2) || (card > 3))
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomInt _domint_le1(SRT_LE, 1)
DomInt _domint_gq1(SRT_GQ, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for cardinality range
DomIntRange _domintrange_lq1(SRT_LQ, 1)
DomIntRange _domintrange_eq2(SRT_EQ, 2)
DomDom _domdom_gq2(SRT_GQ, 2)
DomIntRange _domintrange_sub1(SRT_SUB, 1)
DomDom _domdom_eq2(SRT_EQ, 2)
DomDom _domdom_sub1(SRT_SUB, 1)
SetRelType
Common relation types for sets.
int size(void) const
Return arity.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
Range iterator for singleton range.
DomInt _domint_gq2(SRT_GQ, 2)
const int min
Smallest allowed integer in integer set.
Range iterator for integer sets.
DomInt _domint_eq1(SRT_EQ, 1)
DomInt(Gecode::SetRelType srt0, int n)
Create and register test.
DomIntRange(Gecode::SetRelType srt0, int n)
Create and register test.
DomDom _domdom_cmpl1(SRT_CMPL, 1)
DomRange _domrange_sup1(SRT_SUP, 1)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomInt _domint_disj2(SRT_DISJ, 2)
DomRange _domrange_le1(SRT_LE, 1)
DomIntRange _domintrange_gr2(SRT_GR, 2)
DomDom _domdom_le2(SRT_LE, 2)
Test for equality with an integer range
DomDom _domdom_sub2(SRT_SUB, 2)
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
DomInt _domint_lq1(SRT_LQ, 1)
DomRange _domrange_disj2(SRT_DISJ, 2)
DomDom _domdom_gr1(SRT_GR, 1)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomIntRange _domintrange_gr1(SRT_GR, 1)
DomInt _domint_gr1(SRT_GR, 1)
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
DomDom _domdom_sup2(SRT_SUP, 2)
DomRange _domrange_cmpl2(SRT_CMPL, 2)
int min(void) const
Return smallest value of range.
DomIntRange _domintrange_sup2(SRT_SUP, 2)
DomDom _domdom_lq1(SRT_LQ, 1)
Gecode::IntArgs i(4, 1, 2, 3, 4)
DomInt _domint_eq2(SRT_EQ, 2)
DomDom _domdom_disj1(SRT_DISJ, 1)
int n
Number of negative literals for node type.
DomDom _domdom_nq2(SRT_NQ, 2)
DomDom _domdom_disj2(SRT_DISJ, 2)
DomDom(Gecode::SetRelType srt0, int n)
Create and register test.
DomIntRange _domintrange_cmpl1(SRT_CMPL, 1)
DomRange(SetRelType srt0, int n)
Create and register test.
DomIntRange _domintrange_eq1(SRT_EQ, 1)
DomRange _domrange_gq2(SRT_GQ, 2)
Range iterator for computing intersection (binary)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomRange _domrange_eq1(SRT_EQ, 1)
DomIntRange _domintrange_gq1(SRT_GQ, 1)
DomRange _domrange_nq2(SRT_NQ, 2)
DomDom _domdom_cmpl2(SRT_CMPL, 2)
DomRange _domrange_gr1(SRT_GR, 1)
DomIntRange _domintrange_lq2(SRT_LQ, 2)
A complement iterator spezialized for the BndSet limits.
DomDom _domdom_sup1(SRT_SUP, 1)
DomIntRange _domintrange_disj2(SRT_DISJ, 2)
DomRange _domrange_le2(SRT_LE, 2)
DomRange _domrange_disj1(SRT_DISJ, 1)
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
DomRange _domrange_sup2(SRT_SUP, 2)
Gecode::IntSet lub
The common superset for all domains.
DomIntRange _domintrange_cmpl2(SRT_CMPL, 2)
DomRange _domrange_nq1(SRT_NQ, 1)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomDom _domdom_nq1(SRT_NQ, 1)
DomIntRange _domintrange_nq1(SRT_NQ, 1)
DomRange _domrange_sub2(SRT_SUB, 2)
DomRange _domrange_gq1(SRT_GQ, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomInt _domint_cmpl2(SRT_CMPL, 2)
DomDom _domdom_eq1(SRT_EQ, 1)
Range iterator for computing union (binary)
DomDom _domdom_lq2(SRT_LQ, 2)
DomIntRange _domintrange_le2(SRT_LE, 2)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
union Gecode::@518::NNF::@57 u
Union depending on nodetype t.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomInt _domint_sup1(SRT_SUP, 1)
DomIntRange _domintrange_gq2(SRT_GQ, 2)
DomInt _domint_sub1(SRT_SUB, 1)
DomRange _domrange_gr2(SRT_GR, 2)
DomInt _domint_gr2(SRT_GR, 2)
Node * x
Pointer to corresponding Boolean expression node.
DomRange _domrange_lq2(SRT_LQ, 2)
DomInt _domint_nq2(SRT_NQ, 2)
Base class for tests with set constraints
DomRange _domrange_lq1(SRT_LQ, 1)
Generate all set assignments.
DomDom _domdom_gr2(SRT_GR, 2)
DomInt _domint_le2(SRT_LE, 2)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomRange _domrange_cmpl1(SRT_CMPL, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomDom _domdom_le1(SRT_LE, 1)
Test for equality with an integer
Range iterator producing subsets of an IntSet.
Test for equality with a range
DomRange _domrange_sub1(SRT_SUB, 1)
DomIntRange _domintrange_le1(SRT_LE, 1)
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for equality with a domain
DomInt _domint_lq2(SRT_LQ, 2)
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
DomRange _domrange_eq2(SRT_EQ, 2)
Range iterator for computing set difference.
DomDom _domdom_gq1(SRT_GQ, 1)
DomInt _domint_disj1(SRT_DISJ, 1)
int size(void) const
Return size of array (number of elements)
DomInt _domint_sub2(SRT_SUB, 2)
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
DomInt _domint_nq1(SRT_NQ, 1)
DomIntRange _domintrange_sup1(SRT_SUP, 1)
DomInt _domint_cmpl1(SRT_CMPL, 1)
DomIntRange _domintrange_sub2(SRT_SUB, 2)
DomIntRange _domintrange_nq2(SRT_NQ, 2)
CardRange(int n)
Create and register test.
DomInt _domint_sup2(SRT_SUP, 2)
DomIntRange _domintrange_disj1(SRT_DISJ, 1)