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>
258 const IntSet& z, View1 y) {
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++) {
344 BndSetRanges>
inter(left, right);
348 forbidden(inter, yub);
353 for (
int i=xsize;
i--;)
354 rightSet[
i].dispose(home);
359 for(
int i=0;
i<
x.size();
i++){
361 while (
i<
x.size() &&
x[
i].assigned()) {
363 if (intOfDets.intersectI(home,det)) {repeat =
true;}
365 if (intOfDets.size()==0) {
367 intOfDets.dispose(home);
378 intOfDets.dispose(home);
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
IntersectionN(Space &home, bool share, IntersectionN &p)
Constructor for cloning p.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
bool shared
Whether the any views share a variable implementation.
Range iterator for integer sets.
ExecStatus ES_SUBSUMED(Propagator &p)
static ExecStatus post(Home home, ViewArray< View0 > &y, View1 x)
Post propagator .
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Intersection(Space &home, bool share, Intersection &p)
Constructor for cloning p.
Shrinking sets of integers.
Mixed (n+1)-ary propagator.
int ModEvent
Type for modification events.
virtual Actor * copy(Space &home, bool)
Copy propagator during cloning.
Range iterator for the greatest lower bound.
ExecStatus interCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
Propagation has computed fixpoint.
const unsigned int card
Maximum cardinality of an integer set.
#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.
static ExecStatus post(Home home, View0 x, View1 y, View2 z)
Post propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Range iterator for computing intersection (binary)
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)
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
Range iterator for integer sets.
LUBndSet intOfDets
Intersection of the determined (which are dropped)
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
#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 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)
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
Node * x
Pointer to corresponding Boolean expression node.
Range iterator for intersection of iterators.
Growing sets of integers.
Propagator for set equality
Propagation has not computed fixpoint.
int size(void) const
Return size of array (number of elements)
Gecode toplevel namespace
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
Range iterator for computing set difference.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
static ExecStatus post(Home home, View0, View1)
Post propagator .
void * ralloc(size_t s)
Allocate memory from region.
Propagator for nary intersection
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
bool viewarrayshared(const Space &home, const ViewArray< View0 > &va, const View1 &y)
Propagator for ternary intersection