38 template<
class View,
class View0,
class View1>
50 template<
class View,
class View0,
class View1>
60 template<
class View,
class View0,
class View1>
67 template<
class View,
class View0,
class View1>
75 template<
class View,
class View0,
class View1>
89 template<
class View,
class View0,
class View1>
104 template<
class View,
class View0,
class View1>
110 template<
class View,
class View0,
class View1>
144 if (
iv[i].idx < vx0ub.
val()) {
149 assert(
iv[i].idx == vx0ub.
val());
152 View candidate =
iv[j].view;
153 int candidateInd =
iv[j].idx;
166 if (candidate.cardMax() <
x1.cardMin() ||
168 ModEvent me = (
x0.exclude(home,candidateInd));
179 if (vx0() && vx0.
val()==candidateInd) {
182 ModEvent me = candidate.includeI(home,x1lb);
187 me =
x1.intersectI(home,candub);
193 before[j].
update(home,sofarBefore);
204 for (
int k=i; k<n; k++) {
210 if (
x0.cardMax()==0) {
239 for (
int i=n; i--;) {
240 if (sofarAfter.
size() == 0)
break;
255 me =
iv[i].view.excludeI(home,diff);
269 if (
x0.assigned() && !
x1.assigned()) {
270 int ubsize =
static_cast<int>(
x0.lubSize());
278 }
else if (ubsize == 2) {
284 }
else if (ubsize == 1) {
294 bool allAssigned =
true;
295 for (
int i=
iv.size(); i--;) {
296 if (!
iv[i].view.assigned()) {
301 if (
x1.assigned() &&
x0.assigned() && allAssigned) {
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Range iterator for integer sets.
void update(Space &home, IdxViewArray< View > &x)
Cloning.
int size(void) const
Return the current size.
Range iterator for computing set difference.
Range iterator for computing intersection (binary)
Range iterator for singleton range.
Value iterator from range iterator.
int val(void) const
Return current value.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for propagators.
Propagator(Home home)
Constructor for posting.
Range iterator for integer sets.
unsigned int size(void) const
Return size.
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.
Propagator for element with intersection
ElementIntersection(Space &home, ElementIntersection &p)
Constructor for cloning p.
Gecode::Int::IdxViewArray< View > IdxViewArray
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(Home home, IdxViewArray &x, View0 y, View1 z, const IntSet &u)
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.
Propagator for nary intersection
Propagator for ternary intersection
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
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.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
@ AP_DISPOSE
Actor must always be disposed.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Gecode toplevel namespace
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.