38 template<
class SView,
class RView>
49 for (
unsigned int i=iv0.
size(); i--;)
53 template<
class SView,
class RView>
61 for (
unsigned int i=
n_iv; i--;)
65 template<
class SView,
class RView>
71 template<
class SView,
class RView>
78 template<
class SView,
class RView>
86 for (
unsigned int i=
n_iv; i--;)
92 template<
class SView,
class RView>
107 template<
class SView,
class RView>
113 template<
class SView,
class RView>
118 bool* stillSelected =
r.alloc<
bool>(
n_iv);
123 for (
int i=
n_iv; i--;)
124 stillSelected[i] =
false;
148 unsigned int maxCard = 0;
162 bool selectSingleInconsistent =
false;
163 if (
x1.cardMax() <= 1) {
168 selectSingleInconsistent = diff2() || candidateCard <
x0.cardMin();
179 if (selectSingleInconsistent ||
180 candidateCard >
x0.cardMax() ||
186 stillSelected[i] =
true;
189 if (vx1() && vx1.
val()==i) {
199 before[i].
update(home,sofarBefore);
204 maxCard = std::max(maxCard, candidateCard);
205 minCard = std::min(minCard, candidateCard);
211 if (
x1.cardMax()==0) {
216 for (
int i=
n_iv; i--;)
217 if (stillSelected[i])
224 if (
x1.cardMin() > 0) {
231 me =
x0.cardMin(home, minCard);
237 if (
x1.cardMax() <= 1) {
257 for (
int i=
n_iv; i--;) {
258 if (!stillSelected[i])
286 assert(
x0.assigned());
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
int size(void) const
Return size of array (number of elements)
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Range iterator for integer sets.
Range iterator for computing set difference.
Range iterator for singleton range.
Value iterator from range iterator.
int val(void) const
Return current value.
Range iterator for computing union (binary)
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
size_t size
The size of the propagator (used during subsumption)
Propagator(Home home)
Constructor for posting.
Range iterator for integer sets.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
void dispose(Space &home)
Free memory used by this set.
ElementUnionConst(Space &home, ElementUnionConst &p)
Constructor for cloning p.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Growing sets of integers.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
Range iterator for the greatest lower bound.
Shrinking sets of integers.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
Range iterator for the least upper bound.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
int ModEventDelta
Modification event deltas.
bool failed(void) const
Check whether space is failed.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
@ AP_DISPOSE
Actor must always be disposed.
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.
const int min
Smallest allowed integer in integer set.
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
const Gecode::ModEvent ME_SET_FAILED
Domain operation has resulted in failure.
Gecode toplevel namespace
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Post propagator for SetVar SetOpType SetVar SetRelType r
SetExpr inter(const SetVarArgs &)
Intersection of set variables.
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
int ModEvent
Type for modification events.