%Test whether \a x is solution
| 354 | : Test("Arithmetic::Sqrt::XX::"+s,1,d,st,CPLT_ASSIGNMENT,false) {} |
| 355 | /// %Test whether \a x is solution |
| 356 | virtual MaybeType solution(const Assignment& x) const { |
| 357 | switch (cmp(x[0], Gecode::FRT_GQ, 0.0)) { |
| 358 | case MT_FALSE: return MT_FALSE; |
| 359 | case MT_MAYBE: return MT_MAYBE; |
| 360 | default: |
| 361 | return eq(sqrt(x[0]), x[0]); |
| 362 | } |
| 363 | } |
| 364 | /// Post constraint on \a x |
| 365 | virtual void post(Gecode::Space& home, Gecode::FloatVarArray& x) { |
| 366 | Gecode::sqrt(home, x[0], x[0]); |