64 ++sel2, selected++) {}
70 for (
int i=selected; i--;++selector) {
71 if (selector.
val()>=3 || selector.
val()<0) {
92 for (
int i=x.
size()-2; i--;)
108 :
SetTest(t,2,ds_13,false), i0(-3,-3), i1(-1,1), i2(0,2) {}
113 ++sel2, selected++) {}
117 IntSet iss[] = {i0, i1, i2};
120 for (
int i=selected; i--;++selector) {
121 if (selector.
val()>=3 || selector.
val()<0) {
125 sel[i].
init(iss[selector.
val()]);
142 xs[0] = i0; xs[1] = i1; xs[2] = i2;
158 ++sel2, selected++) {}
164 for (
int i=selected; i--;++selector) {
165 if (selector.
val()>=3 || selector.
val()<0) {
185 for (
int i=x.
size()-2; i--;)
202 ++sel2, selected++) {}
208 for (
int i=selected; i--;++selector) {
209 if (selector.
val()>=3 || selector.
val()<0) {
229 for (
int i=x.
size()-2; i--;)
247 ++sel2, selected++) {
256 unsigned int cardsum = 0;
257 for (
int i=selected; i--;++selector) {
258 if (selector.
val()>=3 || selector.
val()<0) {
282 for (
int i=x.
size()-2; i--;)
294 :
SetTest(t,4,ds_12,false,true) {}
306 for (
int i=x.
size()-1; i--;)
322 :
SetTest(t,1,ds_13,false,true), i0(-3,-3), i1(-1,1), i2(0,2) {}
328 IntSet iss[] = {i0, i1, i2};
335 xs[0] = i0; xs[1] = i1; xs[2] = i2;
360 if ((y[0] > 1) || (y[1] > 1))
373 element(home, m, y[0], y[1], x[0]);
Range iterator for integer sets.
void init(const IntSet &s)
Initialize with ranges for set s.
Range iterator for intersection of iterators.
Range iterator for union of iterators.
void reset(void)
Reset iterator to start.
Matrix-interface for arrays.
int size(void) const
Return size of array (number of elements).
Base class for assignments
Test for Region memory area
Range iterator producing subsets of an IntSet.
void init(const Gecode::IntSet &d, int cur)
Initialize with set d0 and bit-pattern cur0.
Value iterator producing subsets of an IntSet.
int val(void) const
Return current value.
Test for ElementDisjoint constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
ElementDisjoint(const char *t)
Create and register test.
Test for ElementInter constraint
ElementInterIn(const char *t)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for ElementInter constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
ElementInter(const char *t)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for ElementSetConst constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
ElementSetConst(const char *t)
Create and register test.
Test for ElementSet constraint
ElementSet(const char *t)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &y)
Post constraint on x.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Test for ElementUnionConst constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
ElementUnionConst(const char *t)
Create and register test.
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
Test for ElementUnion constraint
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
virtual void post(Space &home, SetVarArray &x, IntVarArray &)
Post constraint on x.
ElementUnion(const char *t)
Create and register test.
Test for matrix element with integer set array and set variable
Gecode::IntSetArgs tm
Array for test matrix.
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x, Gecode::IntVarArray &y)
Post constraint on x and y.
MatrixIntSet(void)
Create and register test.
virtual bool solution(const SetAssignment &x) const
Test whether x is solution
Generate all set assignments.
int intval(void) const
Return value for first integer variable.
const Test::Int::Assignment & ints(void) const
Return assignment for integer variables.
Gecode::IntSet lub
The common superset for all domains.
SetTest(const std::string &s, int a, const Gecode::IntSet &d, bool r=false, int w=0)
Constructor.
@ SOT_DUNION
Disjoint union.
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 unsigned int card
Maximum cardinality of an integer set.
Gecode toplevel namespace
ArgArray< IntSet > IntSetArgs
Passing set arguments.
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Tests for set element constraints
ElementInter _elementinter("Element::Inter")
ElementInterIn _elementinterin("Element::InterIn")
ElementSetConst _elementsetconst("Element::SetConst")
ElementUnionConst _elementunionconst("Element::UnionConst")
ElementDisjoint _elementdisjoint("Element::Disjoint")
ElementUnion _elementunion("Element::Union")
ElementSet _elementset("Element::Set")