| 77 | |
| 78 | template<class VY> |
| 79 | void |
| 80 | IntBase<VY>::disjoint(Space& home, Region& r, int*& dis, int& n_dis) { |
| 81 | // Compute positions of disjoint views |
| 82 | int n=x.size(); |
| 83 | dis = r.alloc<int>(n); n_dis = 0; |
| 84 | |
| 85 | int i=0; |
| 86 | while (i < n) |
| 87 | switch (vs.compare(x[i])) { |
| 88 | case Iter::Ranges::CS_SUBSET: |
| 89 | // All values are already contained in vs, eliminate x[i] |
| 90 | x[i].cancel(home, *this, PC_INT_DOM); |
| 91 | x[i] = x[--n]; |
| 92 | break; |
| 93 | case Iter::Ranges::CS_DISJOINT: |
| 94 | dis[n_dis++] = i++; |
| 95 | break; |
| 96 | case Iter::Ranges::CS_NONE: |
| 97 | i++; |
| 98 | break; |
| 99 | default: |
| 100 | GECODE_NEVER; |
| 101 | } |
| 102 | x.size(n); |
| 103 | } |
| 104 | |
| 105 | template<class VY> |
| 106 | void |