Post constraint on \a x
| 69 | } |
| 70 | /// Post constraint on \a x |
| 71 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 72 | if (!useCount) { |
| 73 | Gecode::distinct(home, x, ipl); |
| 74 | } else { |
| 75 | Gecode::IntSetRanges dr(dom); |
| 76 | int i = 0; |
| 77 | Gecode::IntArgs ia(Gecode::Iter::Ranges::size(dr)); |
| 78 | for (Gecode::IntSetValues dr2(dom); dr2(); ++dr2) |
| 79 | ia[i++] = dr2.val(); |
| 80 | Gecode::count(home, x, Gecode::IntSet(0,1), ia, ipl); |
| 81 | } |
| 82 | } |
| 83 | }; |
| 84 | |
| 85 | /// Simple test for distinct constraint with offsets |