%Test whether \a x is solution
| 463 | : SetTest("Dom::CardRange::"+str(n),n,d1,false) {} |
| 464 | /// %Test whether \a x is solution |
| 465 | virtual bool solution(const SetAssignment& x) const { |
| 466 | for (int i=x.size(); i--; ) { |
| 467 | CountableSetRanges xr(x.lub, x[i]); |
| 468 | unsigned int card = Iter::Ranges::size(xr); |
| 469 | if ((card < 2) || (card > 3)) |
| 470 | return false; |
| 471 | } |
| 472 | return true; |
| 473 | } |
| 474 | /// Post constraint on \a x |
| 475 | virtual void post(Space& home, SetVarArray& x, IntVarArray&) { |
| 476 | if (x.size() == 1) |