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) {
293 for (
int i = xsize;
i--; ) {
313 for (
int i = xsize;
i--; ) {
323 new (&rightSet[xsize-1])
GLBndSet(home);
325 for (
int i=xsize-1;
i--;) {
336 for (
int i=0;
i<xsize;
i++) {
340 BndSetRanges>
inter(left, right);
344 forbidden(inter, yub);
349 for (
int i=xsize;
i--;)
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
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)
virtual Actor * copy(Space &home)
Copy propagator during cloning.
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.
IntersectionN(Space &home, IntersectionN &p)
Constructor for cloning p.
ActorLink * prev(void) const
Routines for double-linked list.
Shrinking sets of integers.
Mixed (n+1)-ary propagator.
int ModEvent
Type for modification events.
Range iterator for the greatest lower bound.
ExecStatus interCard(Space &home, bool &retmodified, View0 &x0, View1 &x1, View2 &x2)
ViewArray< View0 > x
Array of views.
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.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
unsigned int size(void) const
Return size.
Intersection(Space &home, Intersection &p)
Constructor for cloning p.
Gecode::IntArgs i({1, 2, 3, 4})
Range iterator for computing intersection (binary)
Mixed ternary propagator.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Range iterator for integer sets.
bool viewarrayshared(const ViewArray< View0 > &va, const View1 &y)
LUBndSet intOfDets
Intersection of the determined (which are dropped)
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
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 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)
Post propagator for SetVar SetOpType SetVar SetRelType r
SetExpr inter(const SetVarArgs &x)
Intersection of set variables.
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
Post propagator for SetVar SetOpType SetVar y
Range iterator for intersection of iterators.
bool assigned(void) const
Test if all variables are assigned.
Growing sets of integers.
Propagator for set equality
Post propagator for SetVar x
Propagation has not computed fixpoint.
Gecode toplevel namespace
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
Range iterator for computing set difference.
bool shared(ViewArray< ViewX > x, ViewArray< ViewY > y)
int size(void) const
Return size of array (number of elements)
int ModEventDelta
Modification event deltas.
Home class for posting propagators
void * ralloc(size_t s)
Allocate memory from region.
Propagator for nary intersection
static ExecStatus post(Home home, View0 x, View1 y)
Post propagator .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Propagator for ternary intersection