Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
namespace Element {
42 template<
class View,
class View0,
class View1>
47 :
Propagator(home), universe(theUniverse), iv(iv0), x0(y0), x1(y1) {
54 template<
class View,
class View0,
class View1>
60 x0.update(home,share,
p.x0);
61 x1.update(home,share,
p.x1);
66 template<
class View,
class View0,
class View1>
73 template<
class View,
class View0,
class View1>
81 template<
class View,
class View0,
class View1>
95 template<
class View,
class View0,
class View1>
110 template<
class View,
class View0,
class View1>
116 template<
class View,
class View0,
class View1>
142 LUBndSet sofarBefore(home,universe);
150 if (iv[
i].idx < vx0ub.
val()) {
155 assert(iv[
i].idx == vx0ub.
val());
158 View candidate = iv[j].view;
159 int candidateInd = iv[j].idx;
172 if (candidate.cardMax() < x1.cardMin() ||
174 ModEvent me = (x0.exclude(home,candidateInd));
185 if (vx0() && vx0.
val()==candidateInd) {
188 ModEvent me = candidate.includeI(home,x1lb);
193 me = x1.intersectI(home,candub);
199 before[j].update(home,sofarBefore);
210 for (
int k=
i; k<
n; k++) {
216 if (x0.cardMax()==0) {
234 ModEvent me = x1.includeI(home,sfB);
241 LUBndSet sofarAfter(home, universe);
245 for (
int i=
n;
i--;) {
246 if (sofarAfter.
size() == 0)
break;
256 ModEvent me = (x0.include(home,iv[
i].idx));
261 me = iv[
i].view.excludeI(home,diff);
275 if (x0.assigned() && !x1.assigned()) {
276 int ubsize =
static_cast<int>(x0.lubSize());
283 ::
post(home(*
this),is,x1)));
284 }
else if (ubsize == 2) {
289 ::
post(home(*
this),
a,
b,x1)));
290 }
else if (ubsize == 1) {
300 bool allAssigned =
true;
301 for (
int i=iv.size();
i--;) {
302 if (!iv[
i].view.assigned()) {
307 if (x1.assigned() && x0.assigned() && allAssigned) {
Propagator for nary intersection
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
bool before(const ConstSetView &x, const ConstSetView &y)
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator for element with intersection
An array of IdxView pairs.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Gecode::IntArgs i(4, 1, 2, 3, 4)
static ExecStatus post(Home home, IdxViewArray &x, View0 y, View1 z, const IntSet &u)
Propagator for set equality
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for both propagators and branchers.
int val(void) const
Return current value.
virtual void reschedule(Space &home)
Schedule function.
Range iterator for integer sets.
Gecode toplevel namespace
Base-class for propagators.
Propagator for ternary intersection
Home class for posting propagators
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
unsigned int size(void) const
Return size.
Value iterator from range iterator.
@ AP_DISPOSE
Actor must always be disposed.
void update(Space &home, bool share, SharedHandle &sh)
Updating during cloning.
Range iterator for computing intersection (binary)
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for computing set difference.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Range iterator for the greatest lower bound.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int size(void) const
Return the current size.
int ModEvent
Type for modification events.
void dispose(Space &home)
Free memory used by this set.
bool failed(void) const
Check whether space is failed.
ElementIntersection(Space &home, bool share, ElementIntersection &p)
Constructor for cloning p.
@ ES_FIX
Propagation has computed fixpoint.
Range iterator for the least upper bound.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
Range iterator for integer sets.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Range iterator for singleton range.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Shrinking sets of integers.
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.