Go to the documentation of this file.
44 namespace Gecode {
namespace Set {
namespace RelOp {
51 template<
class View0,
class View1,
class View2>
57 template<
class View0,
class View1,
class View2>
64 template<
class View0,
class View1,
class View2>
71 template<
class View0,
class View1,
class View2>
74 return new (home)
Union(home,share,*
this);
77 template<
class View0,
class View1,
class View2>
83 bool x0ass = x0.assigned();
84 bool x1ass = x1.assigned();
85 bool x2ass = x2.assigned();
93 bool modified =
false;
116 bool modified2=
false;
119 x1ubmod |= modified2;
120 modified |= modified2;
127 bool modifiedOld = modified;
131 || x0ubmod || modifiedOld)
142 || x1ubmod || modifiedOld)
172 if (x2.cardMax() == 0) {
178 if (x0.cardMax() == 0)
180 if (x1.cardMax() == 0)
188 if (x0ass && x1ass && x2ass)
190 if (x0ass != x0.assigned() ||
191 x1ass != x1.assigned() ||
192 x2ass != x2.assigned()) {
206 template<
class View0,
class View1>
213 template<
class View0,
class View1>
223 template<
class View0,
class View1>
231 template<
class View0,
class View1>
237 template<
class View0,
class View1>
254 template<
class View0,
class View1>
262 template<
class View0,
class View1>
268 template<
class View0,
class View1>
278 bool modified =
false;
279 bool oldModified =
false;
283 oldModified = modified;
285 if (modified || oldModified || ubevent)
287 if (modified || oldModified || ubevent)
289 if (modified || oldModified || anybevent)
291 if (modified || oldModified || lbevent)
293 if (modified || oldModified || cardevent || ubevent) {
298 for(
int i=0;
i<
x.size();
i++){
302 unionOfDets.includeI(home,det);
315 unionOfDets.dispose(home);
UnionN(Space &home, bool share, UnionN &p)
Constructor for cloning p.
Post propagator for SetVar x
Propagator for ternary union
Post propagator for SetVar SetOpType SetVar y
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
Union(Space &home, bool share, Union &p)
Constructor for cloning p.
ExecStatus partitionNXiLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
ExecStatus ES_SUBSUMED(Propagator &p)
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
ViewArray< View0 > x
Array of views.
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Gecode::IntArgs i(4, 1, 2, 3, 4)
Propagator for set equality
bool shared(View0 v0, View1 v1, View2 v2)
Base-class for both propagators and branchers.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
ExecStatus partitionNYUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
bool assigned(void) const
Test whether view is assigned.
Mixed (n+1)-ary propagator.
Range iterator for integer sets.
Mixed ternary propagator.
bool testSetEventCard(ModEvent me0, ModEvent me1, ModEvent me2)
Gecode toplevel namespace
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool viewarrayshared(const Space &home, const ViewArray< View0 > &va, const View1 &y)
bool shared(const Space &home) const
Test whether array contains shared views.
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Home class for posting propagators
Range iterator for computing set difference.
Propagator for nary union
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
unsigned int cardMax(void) const
Return cardinality maximum.
Range iterator for the greatest lower bound.
ExecStatus unionNCard(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
bool shared
Whether the any views share a variable implementation.
int ModEvent
Type for modification events.
GLBndSet unionOfDets
Union of the determined (which are dropped)
ExecStatus unionCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
Range iterator for computing union (binary)
bool testSetEventAnyB(ModEvent me0, ModEvent me1, ModEvent me2)
ExecStatus partitionNYLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
@ ES_FIX
Propagation has computed fixpoint.
Range iterator for the least upper bound.
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Range iterator for integer sets.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
#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.
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
ExecStatus unionNXiUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &)