40 namespace 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) {
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
bool testSetEventAnyB(ModEvent me0, ModEvent me1, ModEvent me2)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
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
UnionN(Space &home, UnionN &p)
Constructor for cloning p.
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.
bool shared
Whether the any views share a variable implementation.
#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)
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.
bool viewarrayshared(const ViewArray< View0 > &va, const View1 &y)
ExecStatus partitionNYUB(Space &home, bool &modified, ViewArray< View0 > &x, View1 &y, GLBndSet &unionOfDets)
bool shared(void) const
Test whether array contains shared views.
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)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
#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 PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
Union(Space &home, Union &p)
Constructor for cloning p.
View1 x1
View of type View1.
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .