%Test whether \a x is solution
| 493 | : Test("Arithmetic::NRoot::N::"+str(_n)+"::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {} |
| 494 | /// %Test whether \a x is solution |
| 495 | virtual MaybeType solution(const Assignment& x) const { |
| 496 | if ((n == 0) || (x[0].max() < 0)) |
| 497 | return MT_FALSE; |
| 498 | return eq(nroot(x[0],n), x[0]); |
| 499 | } |
| 500 | /// Post constraint on \a x |
| 501 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 502 | Gecode::nroot(home, x[0], n, x[0]); |