| 69 | |
| 70 | namespace { |
| 71 | static int minSymDiff(const SetAssignment& x, int i, const IntSet& is) { |
| 72 | typedef Iter::Ranges::Diff<CountableSetRanges,IntSetRanges> DiffA; |
| 73 | CountableSetRanges xr00(x.lub, x[i]); |
| 74 | IntSetRanges xr10(is); |
| 75 | DiffA a(xr00,xr10); |
| 76 | typedef Iter::Ranges::Diff<IntSetRanges,CountableSetRanges> DiffB; |
| 77 | CountableSetRanges xr01(x.lub, x[i]); |
| 78 | IntSetRanges xr11(is); |
| 79 | DiffB b(xr11,xr01); |
| 80 | Iter::Ranges::Union<DiffA,DiffB> u(a,b); |
| 81 | return u() ? u.min() : Gecode::Set::Limits::max+1; |
| 82 | } |
| 83 | template<class I> |
| 84 | static bool in(int i, I& c, bool eq=false) { |
| 85 | if (eq && i==Gecode::Set::Limits::max+1) |