Check whether \a x is solution
| 284 | op(op0), c(c0) {} |
| 285 | /// Check whether \a x is solution |
| 286 | virtual bool solution(const Assignment& x) const { |
| 287 | int n = x.size(); |
| 288 | int b = check(x[n-2],op,x[n-1]); |
| 289 | for (int i=0; i<n-2; i++) |
| 290 | b = check(x[i],op,b); |
| 291 | return b == c; |
| 292 | } |
| 293 | /// Post constraint |
| 294 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 295 | using namespace Gecode; |