38 namespace Gecode {
namespace Set {
48 for (
int i = n;
i--; ) {
62 assert(
fst() != NULL);
68 if (c->
max() >= mi-1) {
69 if (c->
min() > ma+1) {
89 d._glbMin = c->
max()+1;
92 assert(c->
max()+1>=mi);
94 d._glbMax = c->
min()-1;
99 int prevMax = c->
max();
102 while (q->
next() != NULL && q->
next()->
min() <= ma+1) {
104 growth += q->
min()-prevMax-1;
113 d._glbMax = q->
min()-1;
118 assert(oldCNext!=NULL);
120 if (q->
next()==NULL) {
143 LUBndSet::intersect_full(
Space& home,
int mi,
int ma) {
150 while (c != NULL && c->
max() < mi) {
162 bool changed =
false;
176 while (c != NULL && c->
max() <= ma) {
185 if (ma >= c->
min()) {
192 }
else if (p != NULL) {
197 _size -= cc->width();
207 LUBndSet::exclude_full(
Space& home,
int mi,
int ma,
SetDelta& d) {
209 assert(mi <=
max() && ma >=
min() &&
210 (mi >
min() || ma <
max()));
217 if (c->
max() >= mi) {
218 if (c->
min() > ma) {
return result; }
220 if (c->
min()<mi && c->
max() > ma) {
245 d._lubMax = c->
max();
249 d._lubMin = c->
min();
252 while ((cend->
next()!=NULL) && (cend->
next()->
max()<=ma)) {
256 d._lubMax = cend->
max();
269 if (c != NULL && c->
min() <= ma ) {
292 if (
lst()!=NULL ||
size()!=0) {
293 std::cerr<<
"Strange empty set.\n";
298 if (
fst()!=NULL &&
lst()==NULL) {
299 std::cerr<<
"First is not null, last is.\n";
310 std::cerr <<
"Single range list twisted: ("<<min<<
","<<max<<
")" ;
321 if ((max+1)>=c->
min()) {
325 if (c->
next()==NULL && c!=
lst()) {
const FloatNum max
Largest allowed float value.
RangeList * lst(void) const
Return last range.
RangeList * next(void) const
Return next element.
int max(void) const
Return greatest element.
unsigned int width(int i) const
Return width of range at position i.
int min(void) const
Return minimum.
const int max
Largest allowed integer in integer set.
int min(int i) const
Return minimum of range at position i.
RangeList * fst(void) const
Return first range.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
int n
Number of negative literals for node type.
unsigned int size(void) const
Return size.
Gecode::IntArgs i({1, 2, 3, 4})
int max(int i) const
Return maximum of range at position i.
int max(void) const
Return maximum.
unsigned int _size
The size of this set.
bool isConsistent(void) const
Check whether internal invariants hold.
Post propagator for SetVar SetOpType SetVar SetRelType r
int ranges(void) const
Return number of ranges of the specification.
void dispose(Space &home, RangeList *l)
Free memory for all elements between this and l (inclusive)
Lists of ranges (intervals)
Gecode toplevel namespace
BndSet(void)
Default constructor. Creates an empty set.
unsigned int width(void) const
Return width (distance between maximum and minimum)
int min(void) const
Return smallest element.
Finite set delta information for advisors.