Go to the documentation of this file.
44 namespace Gecode {
namespace Set {
namespace RelOp {
51 template<
class View0,
class View1,
class View2>
ExecStatus
53 View0 x0,View1 x1,View2 x2) {
58 template<
class View0,
class View1,
class View2>
64 template<
class View0,
class View1,
class View2>
70 bool x0ass = x0.assigned();
71 bool x1ass = x1.assigned();
72 bool x2ass = x2.assigned();
80 bool modified =
false;
104 bool modified2=
false;
107 x1lbmod |= modified2;
108 modified |= modified2;
115 bool modifiedOld = modified;
119 || x0lbmod || modifiedOld)
130 || x1lbmod || modifiedOld)
176 if (x0ass && x1ass && x2ass)
178 if (x0ass != x0.assigned() ||
179 x1ass != x1.assigned() ||
180 x2ass != x2.assigned()) {
188 template<
class View0,
class View1,
class View2>
191 View0 y0,View1 y1,View2 y2)
195 template<
class View0,
class View1,
class View2>
207 template<
class View0,
class View1>
216 template<
class View0,
class View1>
227 template<
class View0,
class View1>
237 template<
class View0,
class View1>
255 template<
class View0,
class View1>
263 template<
class View0,
class View1>
269 template<
class View0,
class View1>
275 template<
class View0,
class View1>
281 int xsize =
x.size();
284 for (
int i = xsize;
i--; ) {
287 if (
x[
i].cardMax()==0) {
289 intOfDets.dispose(home);
297 for (
int i = xsize;
i--; ) {
317 for (
int i = xsize;
i--; ) {
327 new (&rightSet[xsize-1])
GLBndSet(home);
328 rightSet[xsize-1].
update(home,intOfDets);
329 for (
int i=xsize-1;
i--;) {
340 for (
int i=0;
i<xsize;
i++) {
348 forbidden(
inter, yub);
353 for (
int i=xsize;
i--;)
354 rightSet[
i].dispose(home);
359 for(
int i=0;
i<
x.size();
i++){
363 if (intOfDets.intersectI(home,det)) {repeat =
true;}
365 if (intOfDets.size()==0) {
367 intOfDets.dispose(home);
378 intOfDets.dispose(home);
Propagator for nary intersection
Post propagator for SetVar x
Post propagator for SetVar SetOpType SetVar y
#define GECODE_ME_CHECK_MODIFIED(modified, me)
Check whether me is failed or modified, and forward failure.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
ExecStatus ES_SUBSUMED(Propagator &p)
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from 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)
unsigned int cardMin(void) const
Return cardinality minimum.
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.
bool assigned(void) const
Test whether view is assigned.
Mixed (n+1)-ary propagator.
Range iterator for integer sets.
Mixed ternary propagator.
Gecode toplevel namespace
Intersection(Space &home, bool share, Intersection &p)
Constructor for cloning p.
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
const unsigned int card
Maximum cardinality of an integer set.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
bool viewarrayshared(const Space &home, const ViewArray< View0 > &va, const View1 &y)
Propagator for ternary intersection
bool shared(const Space &home) const
Test whether array contains shared views.
Home class for posting propagators
Range iterator for computing intersection (binary)
Post propagator for SetVar SetOpType SetVar SetRelType r
Range iterator for computing set difference.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
unsigned int cardMax(void) const
Return cardinality maximum.
Range iterator for the greatest lower bound.
LUBndSet intOfDets
Intersection of the determined (which are dropped)
int ModEvent
Type for modification events.
void dispose(Space &home)
Free memory used by this set.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
IntersectionN(Space &home, bool share, IntersectionN &p)
Constructor for cloning p.
@ ES_FIX
Propagation has computed fixpoint.
Range iterator for the least upper bound.
Range iterator for integer sets.
Range iterator for intersection of iterators.
Growing sets of integers.
bool shared
Whether the any views share a variable implementation.
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)
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
ExecStatus interCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
Shrinking sets of integers.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
#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 .