%Test whether \a x is solution
| 299 | : Test("Arithmetic::Sqrt::XY::"+s,2,d,st,CPLT_ASSIGNMENT,false) {} |
| 300 | /// %Test whether \a x is solution |
| 301 | virtual MaybeType solution(const Assignment& x) const { |
| 302 | switch (cmp(x[0], Gecode::FRT_GQ, 0.0)) { |
| 303 | case MT_FALSE: return MT_FALSE; |
| 304 | case MT_MAYBE: return MT_MAYBE; |
| 305 | default: |
| 306 | return eq(sqrt(x[0]), x[1]); |
| 307 | } |
| 308 | } |
| 309 | /// Post constraint on \a x |
| 310 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 311 | if (flip()) |