40namespace 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) {
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);
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);
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);
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);
466 for (
int i=
x.
size(); i--; ) {
469 if ((card < 2) || (card > 3))
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
union Gecode::@603::NNF::@65 u
Union depending on nodetype t.
int n
Number of negative literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
int size(void) const
Return size of array (number of elements)
Range iterator for integer sets.
Range iterator for computing set difference.
Range iterator for computing intersection (binary)
Range iterator for singleton range.
Range iterator for computing union (binary)
Reification specification.
A complement iterator spezialized for the BndSet limits.
static Gecode::Support::RandomGenerator rand
Random number generator.
Range iterator producing subsets of an IntSet.
Test for cardinality range
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
CardRange(int n)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for equality with a domain
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.
DomDom(Gecode::SetRelType srt0, int n)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for equality with an integer range
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
DomIntRange(Gecode::SetRelType srt0, int n)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for equality with an integer
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
DomInt(Gecode::SetRelType srt0, int n)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for equality with a range
virtual void post(Space &home, SetVarArray &x, IntVarArray &, Reify r)
Post reified constraint on x for b.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
DomRange(SetRelType srt0, int n)
Create and register test.
Generate all set assignments.
Base class for tests with set constraints
static std::string str(Gecode::SetRelType srt)
Map set relation to string.
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
@ RM_IMP
Implication for reification.
@ RM_PMI
Inverse implication for reification.
@ RM_EQV
Equivalence for reification (default)
SetRelType
Common relation types for sets.
@ SRT_GQ
Greater or equal ( )
@ SRT_LQ
Less or equal ( )
bool subset(I &i, J &j)
Check whether range iterator i is subset of range iterator j.
unsigned int size(I &i)
Size of all ranges of range iterator i.
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
const int min
Smallest allowed integer in integer set.
const int max
Largest allowed integer in integer set.
Gecode toplevel namespace
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
SetExpr inter(const SetVarArgs &)
Intersection of set variables.
LinIntExpr cardinality(const SetExpr &)
Cardinality of set expression.
DomIntRange _domintrange_sup1(SRT_SUP, 1)
DomIntRange _domintrange_nq1(SRT_NQ, 1)
DomInt _domint_nq1(SRT_NQ, 1)
DomRange _domrange_le1(SRT_LE, 1)
DomIntRange _domintrange_sub2(SRT_SUB, 2)
DomInt _domint_gr1(SRT_GR, 1)
DomIntRange _domintrange_eq1(SRT_EQ, 1)
DomDom _domdom_lq1(SRT_LQ, 1)
DomRange _domrange_gr1(SRT_GR, 1)
DomInt _domint_lq1(SRT_LQ, 1)
DomRange _domrange_sup2(SRT_SUP, 2)
DomDom _domdom_eq1(SRT_EQ, 1)
DomDom _domdom_cmpl1(SRT_CMPL, 1)
DomIntRange _domintrange_gq2(SRT_GQ, 2)
DomDom _domdom_gq1(SRT_GQ, 1)
DomIntRange _domintrange_disj1(SRT_DISJ, 1)
DomRange _domrange_disj1(SRT_DISJ, 1)
DomDom _domdom_disj1(SRT_DISJ, 1)
DomIntRange _domintrange_gq1(SRT_GQ, 1)
DomInt _domint_gr2(SRT_GR, 2)
DomDom _domdom_gq2(SRT_GQ, 2)
DomInt _domint_lq2(SRT_LQ, 2)
DomInt _domint_disj2(SRT_DISJ, 2)
DomRange _domrange_gq1(SRT_GQ, 1)
DomIntRange _domintrange_gr1(SRT_GR, 1)
DomRange _domrange_lq2(SRT_LQ, 2)
DomRange _domrange_gq2(SRT_GQ, 2)
DomDom _domdom_nq1(SRT_NQ, 1)
DomRange _domrange_gr2(SRT_GR, 2)
DomRange _domrange_eq1(SRT_EQ, 1)
DomRange _domrange_nq2(SRT_NQ, 2)
DomInt _domint_le2(SRT_LE, 2)
DomInt _domint_sup2(SRT_SUP, 2)
DomIntRange _domintrange_nq2(SRT_NQ, 2)
DomIntRange _domintrange_gr2(SRT_GR, 2)
DomRange _domrange_lq1(SRT_LQ, 1)
DomIntRange _domintrange_sub1(SRT_SUB, 1)
DomRange _domrange_sub1(SRT_SUB, 1)
DomIntRange _domintrange_cmpl2(SRT_CMPL, 2)
DomRange _domrange_cmpl1(SRT_CMPL, 1)
DomInt _domint_eq1(SRT_EQ, 1)
DomIntRange _domintrange_le1(SRT_LE, 1)
DomDom _domdom_gr1(SRT_GR, 1)
DomInt _domint_sup1(SRT_SUP, 1)
DomDom _domdom_le1(SRT_LE, 1)
DomRange _domrange_cmpl2(SRT_CMPL, 2)
DomRange _domrange_disj2(SRT_DISJ, 2)
DomInt _domint_nq2(SRT_NQ, 2)
DomInt _domint_cmpl1(SRT_CMPL, 1)
DomInt _domint_gq1(SRT_GQ, 1)
DomDom _domdom_sub2(SRT_SUB, 2)
DomIntRange _domintrange_lq2(SRT_LQ, 2)
DomDom _domdom_eq2(SRT_EQ, 2)
DomRange _domrange_sup1(SRT_SUP, 1)
DomRange _domrange_nq1(SRT_NQ, 1)
DomDom _domdom_le2(SRT_LE, 2)
DomInt _domint_eq2(SRT_EQ, 2)
DomIntRange _domintrange_lq1(SRT_LQ, 1)
DomRange _domrange_le2(SRT_LE, 2)
DomDom _domdom_sub1(SRT_SUB, 1)
DomDom _domdom_gr2(SRT_GR, 2)
DomDom _domdom_lq2(SRT_LQ, 2)
DomDom _domdom_sup1(SRT_SUP, 1)
DomIntRange _domintrange_disj2(SRT_DISJ, 2)
DomInt _domint_gq2(SRT_GQ, 2)
DomRange _domrange_eq2(SRT_EQ, 2)
DomDom _domdom_nq2(SRT_NQ, 2)
DomInt _domint_disj1(SRT_DISJ, 1)
DomInt _domint_le1(SRT_LE, 1)
DomRange _domrange_sub2(SRT_SUB, 2)
DomInt _domint_sub1(SRT_SUB, 1)
DomIntRange _domintrange_le2(SRT_LE, 2)
DomInt _domint_cmpl2(SRT_CMPL, 2)
DomDom _domdom_disj2(SRT_DISJ, 2)
DomInt _domint_sub2(SRT_SUB, 2)
DomDom _domdom_cmpl2(SRT_CMPL, 2)
DomIntRange _domintrange_eq2(SRT_EQ, 2)
DomIntRange _domintrange_cmpl1(SRT_CMPL, 1)
DomDom _domdom_sup2(SRT_SUP, 2)
DomIntRange _domintrange_sup2(SRT_SUP, 2)
#define GECODE_NEVER
Assert that this command is never executed.