%Test whether \a x is solution
| 323 | : Test("Arithmetic::Sqrt::XY::Sol::"+s,2,d,st,EXTEND_ASSIGNMENT,false) {} |
| 324 | /// %Test whether \a x is solution |
| 325 | virtual MaybeType solution(const Assignment& x) const { |
| 326 | switch (cmp(x[0], Gecode::FRT_GQ, 0.0)) { |
| 327 | case MT_FALSE: return MT_FALSE; |
| 328 | case MT_MAYBE: return MT_MAYBE; |
| 329 | default: |
| 330 | return eq(sqrt(x[0]), x[1]); |
| 331 | } |
| 332 | } |
| 333 | /// Extend assignment \a x |
| 334 | virtual bool extendAssignment(Assignment& x) const { |
| 335 | Gecode::FloatVal d = sqrt(abs(x[0])); |