42 namespace Gecode {
namespace Set {
51 first(NULL), last(NULL), _size(0),
_card(0) {}
87 _size = static_cast<unsigned int>(mx-mn+1);
127 return static_cast<int>(
c->
min() +
n);
145 if (
d.fst() ==
fst())
164 for (
int i=0;
i<
n;
i++) {
187 new (home)
RangeList(ri.min(),ri.max(),NULL);
189 unsigned int s = ri.
width();
218 assert(
fst()!= that.
fst());
289 _size=static_cast<unsigned int>(ma-mi+1);
294 bool ret = include_full(home, mi, ma,
d);
299 template<
class I>
bool 345 if ((mi >
max()) || (ma <
min())) {
return false; }
346 if (mi <=
min() && ma >=
max() ) {
353 bool ret = exclude_full(home, mi, ma,
d);
361 if ((mi <=
min()) && (ma >=
max())) {
return false; }
362 if (
_size == 0)
return false;
363 if (ma <
min() || mi >
max() ) {
368 bool ret = intersect_full(home, mi, ma);
373 template<
class I>
bool 375 if (
fst()==NULL) {
return false; }
388 template<
class I>
bool 390 if (!
i()) {
return false; }
413 : Iter::Ranges::Compl<Limits::
min,
417 template<
class I>
void bool excludeI(Space &home, I &i)
Exclude all elements in the set represented by i from this set.
BndSetRanges(void)
Default constructor.
const int min
Smallest allowed integer in integer set.
const FloatNum max
Largest allowed float value.
void lst(RangeList *r)
Set last range to r.
RangeList * lst(void) const
Return last range.
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
int max(void) const
Return greatest element.
int min(void) const
Return minimum.
RangesCompl(void)
Default constructor.
int minN(unsigned int n) const
Return n -th smallest element.
static const int MIN_OF_EMPTY
Returned by empty sets when asked for their minimum element.
bool in(int i) const
Test whether i is an element of this set.
Range iterator for computing the complement (described by template arguments)
RangeList * ranges(void) const
Return range list for iteration.
const unsigned int card
Maximum cardinality of an integer set.
const int max
Largest allowed integer in integer set.
RangeList * fst(void) const
Return first range.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
static const int MAX_OF_EMPTY
Returned by empty sets when asked for their maximum element.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
unsigned int size(void) const
Return size.
void become(Space &home, const BndSet &s)
Make this set equal to s.
Range iterator for computing intersection (binary)
void init(Space &home)
Initialize as the empty set.
int max(void) const
Return maximum.
bool intersectI(Space &home, I &i)
Exclude all elements not in the set represented by i from this set.
A complement iterator spezialized for the BndSet limits.
unsigned int size(void) const
Return size (cardinality) of set.
Range iterator for integer sets.
void init(const BndSet &s)
Initialize with BndSet s.
unsigned int _size
The size of this set.
bool isConsistent(void) const
Check whether internal invariants hold.
unsigned int _card
The cardinality this set represents.
GLBndSet(void)
Default constructor. Creates an empty set.
LUBndSet(void)
Default constructor. Creates an empty set.
void init(const Gecode::RangeList *s)
Initialize with BndSet s.
void update(Space &home, BndSet &x)
Update this set to be a clone of set x.
void init(Space &home)
Initialize as the full set including everything between Limits::min and Limits::max.
bool exclude(Space &home, int i, int j, SetDelta &d)
Exclude the set from this set.
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.
Range iterator for computing union (binary)
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
bool intersect(Space &home, int i, int j)
Intersect this set with the set .
bool empty(void) const
Test whether this set is empty.
void dispose(Space &home, RangeList *l)
Free memory for all elements between this and l (inclusive)
Lists of ranges (intervals)
void fst(RangeList *r)
Set first range to r.
Gecode toplevel namespace
bool overwrite(Space &home, I &i)
Overwrite the ranges with those represented by i.
Range iterator for computing set difference.
friend FloatVal max(const FloatVal &x, const FloatVal &y)
friend FloatVal min(const FloatVal &x, const FloatVal &y)
BndSet(void)
Default constructor. Creates an empty set.
unsigned int card(void) const
Return cardinality.
unsigned int width(void) const
Return width (distance between maximum and minimum)
int min(void) const
Return smallest element.
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
void excludeAll(Space &home)
Exclude all elements from this set.
Finite set delta information for advisors.