Go to the documentation of this file.
40 namespace Test {
namespace Set {
51 static const int d1r[4][2] = {
52 {-4,-3},{-1,-1},{1,1},{3,5}
56 static const int d1cr[5][2] = {
65 static const int d2r[2][2] = {
68 static IntSet ds_33c(d2r,2);
84 static bool in(
int i, I&
c,
bool eq=
false) {
100 SetTest(
"Dom::Range::"+str(srt0)+
"::"+str(
n),
n,ds_33,(
n == 1)),
104 for (
int i=
x.size();
i--; ) {
113 if (!((!xr()) || in(minSymDiff(
x,
i,is),dr,
true)))
117 if (!(xr() ? in(minSymDiff(
x,
i,is),dr) : dr()))
121 if (!((!dr()) || in(minSymDiff(
x,
i,is),xr,
true)))
125 if (!(dr() ? in(minSymDiff(
x,
i,is),xr) : xr()))
169 assert(
x.size() == 1);
170 if (Base::rand(2) != 0) {
193 :
SetTest(
"Dom::IntRange::"+str(srt0)+
"::"+str(
n),1,ds_33,
n==1),
197 for (
int i=
x.size();
i--; ) {
207 if (!((!xr()) || in(minSymDiff(
x,
i,is),dr,
true)))
211 if (!(xr() ? in(minSymDiff(
x,
i,is),dr) : dr()))
215 if (!((!dr()) || in(minSymDiff(
x,
i,is),xr,
true)))
219 if (!(dr() ? in(minSymDiff(
x,
i,is),xr) : xr()))
263 assert(
x.size() == 1);
264 if (Base::rand(2) != 0) {
287 SetTest(
"Dom::Int::"+str(srt0)+
"::"+str(
n),
n,ds_33,
n==1),
292 for (
int i=
x.size();
i--; ) {
301 if (!((!xr()) || in(minSymDiff(
x,
i,is),dr,
true)))
305 if (!(xr() ? in(minSymDiff(
x,
i,is),dr) : dr()))
309 if (!((!dr()) || in(minSymDiff(
x,
i,is),xr,
true)))
313 if (!(dr() ? in(minSymDiff(
x,
i,is),xr) : xr()))
359 assert(
x.size() == 1);
360 if (Base::rand(2) != 0) {
384 SetTest(
"Dom::Dom::"+str(srt0)+
"::"+str(
n),
n,d1,(
n == 1)),
388 for (
int i=
x.size();
i--; ) {
397 if (!((!xr()) || in(minSymDiff(
x,
i,is),dr,
true)))
401 if (!(xr() ? in(minSymDiff(
x,
i,is),dr) : dr()))
405 if (!((!dr()) || in(minSymDiff(
x,
i,is),xr,
true)))
409 if (!(dr() ? in(minSymDiff(
x,
i,is),xr) : xr()))
453 assert(
x.size() == 1);
463 :
SetTest(
"Dom::CardRange::"+str(
n),
n,d1,false) {}
466 for (
int i=
x.size();
i--; ) {
DomInt _domint_lq2(SRT_LQ, 2)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomInt _domint_sub1(SRT_SUB, 1)
Post propagator for SetVar x
DomRange _domrange_lq2(SRT_LQ, 2)
DomIntRange _domintrange_gr2(SRT_GR, 2)
Test for equality with an integer range
DomIntRange _domintrange_gr1(SRT_GR, 1)
@ RM_PMI
Inverse implication for reification.
DomInt _domint_nq2(SRT_NQ, 2)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomIntRange _domintrange_disj1(SRT_DISJ, 1)
DomInt _domint_gq1(SRT_GQ, 1)
DomInt _domint_lq1(SRT_LQ, 1)
unsigned int size(I &i)
Size of all ranges of range iterator i.
DomIntRange _domintrange_gq2(SRT_GQ, 2)
const int min
Smallest allowed integer in integer set.
DomRange _domrange_le2(SRT_LE, 2)
DomInt _domint_disj1(SRT_DISJ, 1)
DomRange _domrange_disj2(SRT_DISJ, 2)
DomRange _domrange_sup2(SRT_SUP, 2)
@ RM_IMP
Implication for reification.
DomInt _domint_cmpl1(SRT_CMPL, 1)
DomInt _domint_nq1(SRT_NQ, 1)
DomInt _domint_sub2(SRT_SUB, 2)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomDom _domdom_gr1(SRT_GR, 1)
DomDom(Gecode::SetRelType srt0, int n)
Create and register test.
@ SRT_LQ
Less or equal ( )
DomDom _domdom_sup2(SRT_SUP, 2)
DomDom _domdom_eq2(SRT_EQ, 2)
CardRange(int n)
Create and register test.
@ SRT_GQ
Greater or equal ( )
Test for equality with a domain
DomRange _domrange_lq1(SRT_LQ, 1)
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
Test for cardinality range
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for equality with an integer
Range iterator for integer sets.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomRange _domrange_sub2(SRT_SUB, 2)
DomIntRange _domintrange_disj2(SRT_DISJ, 2)
Generate all set assignments.
DomDom _domdom_nq2(SRT_NQ, 2)
DomInt _domint_gq2(SRT_GQ, 2)
DomRange _domrange_le1(SRT_LE, 1)
DomDom _domdom_le2(SRT_LE, 2)
DomDom _domdom_eq1(SRT_EQ, 1)
DomInt _domint_cmpl2(SRT_CMPL, 2)
DomInt _domint_sup2(SRT_SUP, 2)
Gecode toplevel namespace
DomDom _domdom_sup1(SRT_SUP, 1)
union Gecode::@602::NNF::@65 u
Union depending on nodetype t.
const int max
Largest allowed integer in integer set.
DomRange _domrange_disj1(SRT_DISJ, 1)
DomDom _domdom_sub2(SRT_SUB, 2)
const unsigned int card
Maximum cardinality of an integer set.
A complement iterator spezialized for the BndSet limits.
DomIntRange _domintrange_sup1(SRT_SUP, 1)
DomIntRange _domintrange_cmpl1(SRT_CMPL, 1)
DomInt(Gecode::SetRelType srt0, int n)
Create and register test.
DomRange _domrange_eq2(SRT_EQ, 2)
DomDom _domdom_disj1(SRT_DISJ, 1)
Reification specification.
DomDom _domdom_cmpl2(SRT_CMPL, 2)
@ RM_EQV
Equivalence for reification (default)
DomRange _domrange_gr2(SRT_GR, 2)
DomDom _domdom_sub1(SRT_SUB, 1)
DomInt _domint_eq1(SRT_EQ, 1)
DomRange _domrange_gq1(SRT_GQ, 1)
Range iterator for computing intersection (binary)
DomInt _domint_disj2(SRT_DISJ, 2)
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for computing set difference.
DomInt _domint_le1(SRT_LE, 1)
DomInt _domint_gr1(SRT_GR, 1)
DomDom _domdom_le1(SRT_LE, 1)
DomIntRange _domintrange_lq2(SRT_LQ, 2)
DomRange _domrange_nq2(SRT_NQ, 2)
DomDom _domdom_gq1(SRT_GQ, 1)
Base class for tests with set constraints
LinIntExpr cardinality(const SetExpr &e)
Cardinality of set expression.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
DomDom _domdom_gr2(SRT_GR, 2)
DomRange _domrange_sup1(SRT_SUP, 1)
DomIntRange _domintrange_sub2(SRT_SUB, 2)
SetRelType
Common relation types for sets.
DomDom _domdom_nq1(SRT_NQ, 1)
DomDom _domdom_lq2(SRT_LQ, 2)
DomRange _domrange_nq1(SRT_NQ, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
DomRange _domrange_cmpl1(SRT_CMPL, 1)
DomIntRange _domintrange_nq1(SRT_NQ, 1)
DomIntRange _domintrange_cmpl2(SRT_CMPL, 2)
DomIntRange _domintrange_sup2(SRT_SUP, 2)
DomIntRange _domintrange_nq2(SRT_NQ, 2)
Range iterator for computing union (binary)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomDom _domdom_disj2(SRT_DISJ, 2)
DomInt _domint_eq2(SRT_EQ, 2)
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
DomDom _domdom_gq2(SRT_GQ, 2)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomIntRange _domintrange_eq1(SRT_EQ, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomIntRange(Gecode::SetRelType srt0, int n)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomIntRange _domintrange_lq1(SRT_LQ, 1)
DomRange _domrange_gq2(SRT_GQ, 2)
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomRange _domrange_gr1(SRT_GR, 1)
Range iterator producing subsets of an IntSet.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomIntRange _domintrange_le2(SRT_LE, 2)
DomRange _domrange_sub1(SRT_SUB, 1)
Range iterator for singleton range.
DomInt _domint_le2(SRT_LE, 2)
DomIntRange _domintrange_le1(SRT_LE, 1)
DomIntRange _domintrange_sub1(SRT_SUB, 1)
DomInt _domint_gr2(SRT_GR, 2)
Test for equality with a range
DomRange _domrange_eq1(SRT_EQ, 1)
int n
Number of negative literals for node type.
DomInt _domint_sup1(SRT_SUP, 1)
Gecode::IntArgs i({1, 2, 3, 4})
DomIntRange _domintrange_eq2(SRT_EQ, 2)
DomDom _domdom_lq1(SRT_LQ, 1)
DomRange _domrange_cmpl2(SRT_CMPL, 2)
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
DomRange(SetRelType srt0, int n)
Create and register test.
DomDom _domdom_cmpl1(SRT_CMPL, 1)
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomIntRange _domintrange_gq1(SRT_GQ, 1)