42 namespace Gecode {
namespace Set {
52 for (
int i = n;
i--; ) {
66 assert(
fst() != NULL);
72 if (c->
max() >= mi-1){
73 if (c->
min() > ma+1) {
93 d._glbMin = c->
max()+1;
96 assert(c->
max()+1>=mi);
98 d._glbMax = c->
min()-1;
103 int prevMax = c->
max();
106 while (q->
next() != NULL && q->
next()->
min() <= ma+1) {
108 growth += q->
min()-prevMax-1;
117 d._glbMax = q->
min()-1;
122 assert(oldCNext!=NULL);
124 if (q->
next()==NULL){
147 LUBndSet::intersect_full(
Space& home,
int mi,
int ma) {
154 while (c != NULL && c->
max() < mi) {
166 bool changed =
false;
180 while (c != NULL && c->
max() <= ma) {
189 if (ma >= c->
min()) {
196 }
else if (p != NULL) {
201 _size -= cc->width();
211 LUBndSet::exclude_full(
Space& home,
int mi,
int ma,
SetDelta& d) {
213 assert(mi <=
max() && ma >=
min() &&
214 (mi >
min() || ma <
max()));
222 if (c->
min() > ma) {
return result; }
224 if (c->
min()<mi && c->
max() > ma) {
249 d._lubMax = c->
max();
253 d._lubMin = c->
min();
256 while ((cend->
next()!=NULL) && (cend->
next()->
max()<=ma)){
260 d._lubMax = cend->
max();
273 if (c != NULL && c->
min() <= ma ) {
296 if (
lst()!=NULL ||
size()!=0) {
297 std::cerr<<
"Strange empty set.\n";
302 if (
fst()!=NULL &&
lst()==NULL) {
303 std::cerr<<
"First is not null, last is.\n";
314 std::cerr <<
"Single range list twisted: ("<<min<<
","<<max<<
")" ;
325 if ((max+1)>=c->
min()) {
329 if (c->
next()==NULL && c!=
lst()) {
RangeList * lst(void) const
Return last range.
bool isConsistent(void) const
Check whether internal invariants hold.
const FloatNum max
Largest allowed float value.
int min(void) const
Return minimum.
const int max
Largest allowed integer in integer set.
int max(void) const
Return maximum.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
Gecode::FloatVal c(-8, 8)
unsigned int size(void) const
Return size.
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.
int ranges(void) const
Return number of ranges of the specification.
RangeList * fst(void) const
Return first range.
unsigned int width(int i) const
Return width of range at position i.
unsigned int _size
The size of this set.
RangeList * next(void) const
Return next element.
int min(void) const
Return smallest element.
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.
int max(void) const
Return greatest element.
int max(int i) const
Return maximum of range at position i.
unsigned int width(void) const
Return width (distance between maximum and minimum)
int min(int i) const
Return minimum of range at position i.
Finite set delta information for advisors.