| 38 | namespace Gecode { namespace Set { |
| 39 | |
| 40 | BndSet::BndSet(Space& home, const IntSet& is) { |
| 41 | if (is.ranges()==0) { |
| 42 | fst(nullptr); lst(nullptr); _size = 0; |
| 43 | } else { |
| 44 | int n = is.ranges(); |
| 45 | RangeList* r = home.alloc<RangeList>(n); |
| 46 | fst(r); lst(r+n-1); |
| 47 | unsigned int s = 0; |
| 48 | for (int i = n; i--; ) { |
| 49 | s += is.width(i); |
| 50 | r[i].min(is.min(i)); r[i].max(is.max(i)); |
| 51 | r[i].next(&r[i+1]); |
| 52 | } |
| 53 | r[n-1].next(nullptr); |
| 54 | _size = s; |
| 55 | } |
| 56 | assert(isConsistent()); |
| 57 | } |
| 58 | |
| 59 | bool |
| 60 | GLBndSet::include_full(Space& home, int mi, int ma, SetDelta& d) { |