%Test whether \a x is solution
| 56 | : SetTest(t,4,ds_33,false) {} |
| 57 | /// %Test whether \a x is solution |
| 58 | virtual bool solution(const SetAssignment& x) const { |
| 59 | int max = Gecode::Set::Limits::min - 1; |
| 60 | for (int i=0; i<4; i++) { |
| 61 | CountableSetRanges xir(x.lub, x[i]); |
| 62 | IntSet xi(xir); |
| 63 | if (xi.ranges() > 0) { |
| 64 | int oldMax = max; |
| 65 | max = xi.max(); |
| 66 | if (xi.min() <= oldMax) |
| 67 | return false; |
| 68 | } |
| 69 | } |
| 70 | return true; |
| 71 | } |
| 72 | /// Post constraint on \a x |
| 73 | virtual void post(Space& home, SetVarArray& x, IntVarArray&) { |
| 74 | Gecode::sequence(home, x); |