Check whether \a x is solution
| 254 | } |
| 255 | /// Check whether \a x is solution |
| 256 | virtual bool solution(const Assignment& x) const { |
| 257 | int n = x.size(); |
| 258 | int b = check(x[n-2],op,x[n-1]); |
| 259 | for (int i=0; i<n-2; i++) |
| 260 | b = check(x[i],op,b); |
| 261 | return b == x[n-1]; |
| 262 | } |
| 263 | /// Post constraint |
| 264 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 265 | using namespace Gecode; |