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>
257 const IntSet& z, View1 y) {
262 template<
class View0,
class View1>
268 template<
class View0,
class View1>
278 bool modified =
false;
279 bool oldModified =
false;
282 oldModified = modified;
284 if (modified || oldModified || ubevent)
286 if (modified || oldModified || ubevent)
288 if (modified || oldModified || anybevent)
290 if (modified || oldModified || lbevent)
292 if (modified || oldModified || cardevent || ubevent)
296 for(
int i=0;
i<
x.size();
i++){
298 while (
i<
x.size() &&
x[
i].assigned()) {
300 unionOfDets.includeI(home,det);
310 unionOfDets.dispose(home);
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
bool testSetEventAnyB(ModEvent me0, ModEvent me1, ModEvent me2)
ExecStatus partitionNYLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
Propagator for nary union
Range iterator for integer sets.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ExecStatus ES_SUBSUMED(Propagator &p)
ExecStatus unionNXiUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &)
Propagator for ternary union
Mixed (n+1)-ary propagator.
int ModEvent
Type for modification events.
ExecStatus partitionNXiLB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
Range iterator for the greatest lower bound.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ExecStatus unionNCard(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
Propagation has computed fixpoint.
Union(Space &home, bool share, Union &p)
Constructor for cloning p.
bool shared
Whether the any views share a variable implementation.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
Range iterator for the least upper bound.
Base-class for both propagators and branchers.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
Mixed ternary propagator.
bool shared(const Space &home) const
Test whether array contains shared views.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Range iterator for integer sets.
ExecStatus partitionNYUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
GLBndSet unionOfDets
Union of the determined (which are dropped)
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
const Gecode::PropCond PC_SET_ANY
Propagate when any bound or the cardinality of a view changes.
bool shared(View0 v0, View1 v1, View2 v2)
Range iterator for computing union (binary)
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
Node * x
Pointer to corresponding Boolean expression node.
Propagator for set equality
Propagation has not computed fixpoint.
int size(void) const
Return size of array (number of elements)
bool testSetEventCard(ModEvent me0, ModEvent me1, ModEvent me2)
Gecode toplevel namespace
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
Range iterator for computing set difference.
int ModEventDelta
Modification event deltas.
ExecStatus unionCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
Home class for posting propagators
UnionN(Space &home, bool share, UnionN &p)
Constructor for cloning p.
static ExecStatus post(Home home, View0, View1)
Post propagator .
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
bool viewarrayshared(const Space &home, const ViewArray< View0 > &va, const View1 &y)