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) {
#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
View2 x2
View of type View2.
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)
ViewArray< View0 > x
Array of views.
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.
View0 x0
View of type View0.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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 .
Mixed ternary propagator.
ModEventDelta med
A set of modification events (used during propagation)
Range iterator for integer sets.
ExecStatus partitionNYUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
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.
void move_lst(int i)
Move view from position size()-1 to position i (truncate array by one)
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.
bool shared(View0 v0, View1 v1, View2 v2)
Range iterator for computing union (binary)
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
Post propagator for SetVar SetOpType SetVar y
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
bool assigned(void) const
Test if all variables are assigned.
Propagator for set equality
Post propagator for SetVar x
Propagation has not computed fixpoint.
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 size(void) const
Return size of array (number of elements)
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, ViewArray< View0 > &y, View1 x)
Post propagator .
View1 x1
View of type View1.
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
bool viewarrayshared(const Space &home, const ViewArray< View0 > &va, const View1 &y)