%Test whether \a x is solution
| 456 | } |
| 457 | /// %Test whether \a x is solution |
| 458 | virtual bool solution(const Assignment& x) const { |
| 459 | using namespace Gecode; |
| 460 | for (int i=ts.tuples(); i--; ) { |
| 461 | TupleSet::Tuple t = ts[i]; |
| 462 | bool same = true; |
| 463 | for (int j=0; (j < ts.arity()) && same; j++) |
| 464 | if (t[j] != x[j]) |
| 465 | same = false; |
| 466 | if (same) |
| 467 | return pos; |
| 468 | } |
| 469 | return !pos; |
| 470 | } |
| 471 | /// Post constraint on \a x |
| 472 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 473 | using namespace Gecode; |