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>
87 template<
class View,
class View0,
class View1>
102 template<
class View,
class View0,
class View1>
108 template<
class View,
class View0,
class View1>
134 LUBndSet sofarBefore(home,universe);
142 if (iv[i].idx < vx0ub.
val()) {
147 assert(iv[i].idx == vx0ub.
val());
150 View candidate = iv[j].view;
151 int candidateInd = iv[j].idx;
164 if (candidate.cardMax() < x1.cardMin() ||
166 ModEvent me = (x0.exclude(home,candidateInd));
177 if (vx0() && vx0.
val()==candidateInd) {
180 ModEvent me = candidate.includeI(home,x1lb);
185 me = x1.intersectI(home,candub);
191 before[j].
update(home,sofarBefore);
202 for (
int k=i; k<
n; k++) {
208 if (x0.cardMax()==0) {
219 before[i].dispose(home);
226 ModEvent me = x1.includeI(home,sfB);
233 LUBndSet sofarAfter(home, universe);
237 for (
int i=n; i--;) {
238 if (sofarAfter.
size() == 0)
break;
248 ModEvent me = (x0.include(home,iv[i].idx));
253 me = iv[
i].view.excludeI(home,diff);
267 if (x0.assigned() && !x1.assigned()) {
268 int ubsize =
static_cast<int>(x0.lubSize());
275 ::
post(home(*
this),is,x1)));
276 }
else if (ubsize == 2) {
281 ::
post(home(*
this),a,b,x1)));
282 }
else if (ubsize == 1) {
292 bool allAssigned =
true;
293 for (
int i=iv.
size();
i--;) {
294 if (!iv[
i].view.assigned()) {
299 if (x1.assigned() && x0.assigned() && allAssigned) {
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
static ExecStatus post(Home home, IdxViewArray &x, View0 y, View1 z, const IntSet &u)
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
Range iterator for singleton range.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Range iterator for integer sets.
ExecStatus ES_SUBSUMED(Propagator &p)
Actor must always be disposed.
int size(void) const
Return size of array (number of elements)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Shrinking sets of integers.
int ModEvent
Type for modification events.
Base-class for propagators.
Range iterator for the greatest lower bound.
Propagation has computed fixpoint.
bool failed(void) const
Check whether space is failed.
Range iterator for the least upper bound.
Base-class for both propagators and branchers.
unsigned int size(void) const
Return size.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Range iterator for computing intersection (binary)
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
Value iterator from range iterator.
Range iterator for integer sets.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
ElementIntersection(Space &home, bool share, ElementIntersection &p)
Constructor for cloning p.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
void dispose(Space &home)
Free memory used by this set.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Propagator for element with intersection
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
void update(Space &home, bool share, SharedHandle &sh)
Updating during cloning.
struct Gecode::@519::NNF::@60::@61 b
For binary nodes (and, or, eqv)
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
virtual size_t dispose(Space &home)
Delete actor and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
bool me_modified(ModEvent me)
Check whether modification event me describes variable modification.
Propagator for set equality
int val(void) const
Return current value.
An array of IdxView pairs.
Gecode toplevel namespace
Range iterator for computing set difference.
int ModEventDelta
Modification event deltas.
bool before(const ConstSetView &x, const ConstSetView &y)
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
Home class for posting propagators
Propagator for nary intersection
int size(void) const
Return the current size.
Propagator for ternary intersection
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.