Go to the documentation of this file.
40 namespace Gecode {
namespace Set {
namespace RelOp {
47 template<
class View0,
class View1,
class View2>
ExecStatus
49 View0 x0,View1 x1,View2 x2) {
54 template<
class View0,
class View1,
class View2>
60 template<
class View0,
class View1,
class View2>
66 bool x0ass = x0.assigned();
67 bool x1ass = x1.assigned();
68 bool x2ass = x2.assigned();
76 bool modified =
false;
100 bool modified2=
false;
103 x1lbmod |= modified2;
104 modified |= modified2;
111 bool modifiedOld = modified;
115 || x0lbmod || modifiedOld)
126 || x1lbmod || modifiedOld)
172 if (x0ass && x1ass && x2ass)
174 if (x0ass != x0.assigned() ||
175 x1ass != x1.assigned() ||
176 x2ass != x2.assigned()) {
184 template<
class View0,
class View1,
class View2>
187 View0 y0,View1 y1,View2 y2)
191 template<
class View0,
class View1,
class View2>
203 template<
class View0,
class View1>
212 template<
class View0,
class View1>
223 template<
class View0,
class View1>
233 template<
class View0,
class View1>
251 template<
class View0,
class View1>
259 template<
class View0,
class View1>
265 template<
class View0,
class View1>
271 template<
class View0,
class View1>
277 int xsize =
x.size();
280 for (
int i = xsize;
i--; ) {
283 if (
x[
i].cardMax()==0) {
285 intOfDets.dispose(home);
293 for (
int i = xsize;
i--; ) {
313 for (
int i = xsize;
i--; ) {
323 new (&rightSet[xsize-1])
GLBndSet(home);
324 rightSet[xsize-1].
update(home,intOfDets);
325 for (
int i=xsize-1;
i--;) {
336 for (
int i=0;
i<xsize;
i++) {
344 forbidden(
inter, yub);
349 for (
int i=xsize;
i--;)
350 rightSet[
i].dispose(home);
355 for(
int i=0;
i<
x.size();
i++) {
359 if (intOfDets.intersectI(home,det)) {repeat =
true;}
361 if (intOfDets.size()==0) {
363 intOfDets.dispose(home);
374 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.
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
unsigned int cardMin(void) const
Return cardinality minimum.
Propagator for set equality
bool shared(View0 v0, View1 v1, View2 v2)
bool viewarrayshared(const ViewArray< View0 > &va, const View1 &y)
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
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.
Propagator for ternary intersection
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)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
int ModEvent
Type for modification events.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
void dispose(Space &home)
Free memory used by this set.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Intersection(Space &home, Intersection &p)
Constructor for cloning p.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
@ 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.
IntersectionN(Space &home, IntersectionN &p)
Constructor for cloning p.
int ModEventDelta
Modification event deltas.
@ ES_NOFIX
Propagation has not computed fixpoint.
Gecode::IntArgs i({1, 2, 3, 4})
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 .