%Test whether \a x is solution
| 578 | } |
| 579 | /// %Test whether \a x is solution |
| 580 | virtual bool solution(const Assignment& x) const { |
| 581 | using namespace Gecode; |
| 582 | for (int i = 0; i < t.tuples(); ++i) { |
| 583 | TupleSet::Tuple l = t[i]; |
| 584 | bool same = true; |
| 585 | for (int j = 0; j < t.arity() && same; ++j) |
| 586 | if (l[j] != x[j]) |
| 587 | same = false; |
| 588 | if (same) |
| 589 | return pos; |
| 590 | } |
| 591 | return !pos; |
| 592 | } |
| 593 | /// Post constraint on \a x |
| 594 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 595 | using namespace Gecode; |