Post constraint on \a x
| 94 | } |
| 95 | /// Post constraint on \a x |
| 96 | virtual void post(Space& home, SetVarArray& x, IntVarArray&) { |
| 97 | SetVar s1(home, IntSet::empty, -2, 2, 0U, 1U); |
| 98 | Gecode::rel(home, x[0], SOT_INTER, x[1], SRT_EQ, s1); |
| 99 | SetVar s2(home, IntSet::empty, -2, 2, 0U, 1U); |
| 100 | Gecode::rel(home, x[0], SOT_INTER, x[2], SRT_EQ, s2); |
| 101 | SetVar s3(home, IntSet::empty, -2, 2, 0U, 1U); |
| 102 | Gecode::rel(home, x[1], SOT_INTER, x[2], SRT_EQ, s3); |
| 103 | Gecode::atmostOne(home, x, 3); |
| 104 | } |
| 105 | }; |
| 106 | AtmostOne _atmostone("Distinct::AtmostOne"); |
| 107 |