%Test whether \a x is solution
| 440 | : Test("Arithmetic::NRoot::N::"+str(_n)+"::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false), n(_n) {} |
| 441 | /// %Test whether \a x is solution |
| 442 | virtual MaybeType solution(const Assignment& x) const { |
| 443 | if ((n == 0) || (x[0].max() < 0.0)) |
| 444 | return MT_FALSE; |
| 445 | return eq(nroot(x[0],n), x[1]); |
| 446 | } |
| 447 | /// Post constraint on \a x |
| 448 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 449 | if (flip()) |