38namespace Gecode {
namespace Set {
47 first(NULL), last(NULL), _size(0), _card(0) {}
83 _size =
static_cast<unsigned int>(mx-mn+1);
123 return static_cast<int>(c->
min() +
n);
141 if (d.fst() ==
fst())
152 for (
RangeList* c = d.fst(); c != NULL; c = c->next())
160 for (
int i=0; i<
n; i++) {
183 new (home)
RangeList(ri.min(),ri.max(),NULL);
185 unsigned int s = ri.width();
214 assert(
fst()!= that.
fst());
226 if (c->
min() <= i && c->
max() >= i)
285 _size=
static_cast<unsigned int>(ma-mi+1);
290 bool ret = include_full(home, mi, ma, d);
295 template<
class I>
bool
341 if ((mi >
max()) || (ma <
min())) {
return false; }
342 if (mi <=
min() && ma >=
max() ) {
349 bool ret = exclude_full(home, mi, ma, d);
357 if ((mi <=
min()) && (ma >=
max())) {
return false; }
358 if (
_size == 0)
return false;
359 if (ma <
min() || mi >
max() ) {
364 bool ret = intersect_full(home, mi, ma);
369 template<
class I>
bool
371 if (
fst()==NULL) {
return false; }
384 template<
class I>
bool
386 if (!i()) {
return false; }
409 : Iter::Ranges::Compl<Limits::
min,
413 template<
class I>
void
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
unsigned int size(void) const
Return size (cardinality) of set.
Range iterator for computing the complement (described by template arguments)
Range iterator for computing set difference.
Range iterator for computing intersection (binary)
void init(const Gecode::RangeList *s)
Initialize with range list s.
Range iterator for computing union (binary)
Lists of ranges (intervals)
int max(void) const
Return maximum.
int min(void) const
Return minimum.
void dispose(Space &home, RangeList *l)
Free memory for all elements between this and l (inclusive)
RangeList * next(void) const
Return next element.
unsigned int width(void) const
Return width (distance between maximum and minimum)
Range iterator for integer sets.
BndSetRanges(void)
Default constructor.
void init(const BndSet &s)
Initialize with BndSet s.
int min(void) const
Return smallest element.
bool isConsistent(void) const
Check whether internal invariants hold.
int minN(unsigned int n) const
Return n -th smallest element.
bool overwrite(Space &home, I &i)
Overwrite the ranges with those represented by i.
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
RangeList * lst(void) const
Return last range.
void fst(RangeList *r)
Set first range to r.
unsigned int size(void) const
Return size.
void lst(RangeList *r)
Set last range to r.
BndSet(void)
Default constructor. Creates an empty set.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
unsigned int _card
The cardinality this set represents.
bool empty(void) const
Test whether this set is empty.
bool in(int i) const
Test whether i is an element of this set.
void become(Space &home, const BndSet &s)
Make this set equal to s.
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
int max(void) const
Return greatest element.
unsigned int card(void) const
Return cardinality.
RangeList * ranges(void) const
Return range list for iteration.
void dispose(Space &home)
Free memory used by this set.
unsigned int _size
The size of this set.
RangeList * fst(void) const
Return first range.
GLBndSet(void)
Default constructor. Creates an empty set.
bool includeI(Space &home, I &i)
Include the set represented by i in this set.
void init(Space &home)
Initialize as the empty set.
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
void init(Space &home)
Initialize as the full set including everything between Limits::min and Limits::max.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
bool excludeI(Space &home, I &i)
Exclude all elements in the set represented by i from this set.
LUBndSet(void)
Default constructor. Creates an empty set.
bool intersect(Space &home, int i, int j)
Intersect this set with the set .
void excludeAll(Space &home)
Exclude all elements from this set.
bool exclude(Space &home, int i, int j, SetDelta &d)
Exclude the set from this set.
void init(I &i)
Initialize with iterator i.
RangesCompl(void)
Default constructor.
Finite set delta information for advisors.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
const int min
Smallest allowed integer in integer set.
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .