40namespace Gecode {
namespace Set {
namespace RelOp {
47 template<
class View0,
class View1,
class View2>
53 template<
class View0,
class View1,
class View2>
60 template<
class View0,
class View1,
class View2>
67 template<
class View0,
class View1,
class View2>
70 return new (home)
Union(home,*
this);
73 template<
class View0,
class View1,
class View2>
79 bool x0ass = x0.assigned();
80 bool x1ass = x1.assigned();
81 bool x2ass = x2.assigned();
89 bool modified =
false;
112 bool modified2=
false;
115 x1ubmod |= modified2;
116 modified |= modified2;
123 bool modifiedOld = modified;
127 || x0ubmod || modifiedOld)
138 || x1ubmod || modifiedOld)
168 if (x2.cardMax() == 0) {
174 if (x0.cardMax() == 0)
176 if (x1.cardMax() == 0)
184 if (x0ass && x1ass && x2ass)
186 if (x0ass != x0.assigned() ||
187 x1ass != x1.assigned() ||
188 x2ass != x2.assigned()) {
202 template<
class View0,
class View1>
209 template<
class View0,
class View1>
219 template<
class View0,
class View1>
227 template<
class View0,
class View1>
233 template<
class View0,
class View1>
250 template<
class View0,
class View1>
258 template<
class View0,
class View1>
264 template<
class View0,
class View1>
274 bool modified =
false;
275 bool oldModified =
false;
279 oldModified = modified;
281 if (modified || oldModified || ubevent)
283 if (modified || oldModified || ubevent)
285 if (modified || oldModified || anybevent)
287 if (modified || oldModified || lbevent)
289 if (modified || oldModified || cardevent || ubevent) {
294 for(
int i=0;i<
x.size();i++) {
298 unionOfDets.includeI(home,det);
311 unionOfDets.dispose(home);
int p
Number of positive literals for node type.
Base-class for both propagators and branchers.
Home class for posting propagators
Range iterator for integer sets.
Range iterator for computing set difference.
Range iterator for computing union (binary)
Mixed (n+1)-ary propagator.
Mixed ternary propagator.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
unsigned int cardMax(void) const
Return cardinality maximum.
Range iterator for integer sets.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
Range iterator for the greatest lower bound.
Range iterator for the least upper bound.
Propagator for nary union
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
GLBndSet unionOfDets
Union of the determined (which are dropped)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
bool shared
Whether the any views share a variable implementation.
UnionN(Space &home, UnionN &p)
Constructor for cloning p.
Propagator for ternary union
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Union(Space &home, Union &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for set equality
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
bool assigned(void) const
Test whether view is assigned.
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#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.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
bool shared(View0 v0, View1 v1, View2 v2)
ExecStatus partitionNYLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
ExecStatus unionNCard(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
ExecStatus unionNXiUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &)
ExecStatus unionCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
ExecStatus partitionNXiLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
ExecStatus partitionNYUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
bool testSetEventCard(ModEvent me0, ModEvent me1, ModEvent me2)
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
bool testSetEventAnyB(ModEvent me0, ModEvent me1, ModEvent me2)
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
Gecode toplevel namespace
bool viewarrayshared(const ViewArray< View0 > &va, const View1 &y)
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
Post propagator for SetVar x
int ModEvent
Type for modification events.