MCPcopy Create free account
hub / github.com/Gecode/gecode / solution

Method solution

test/float/arithmetic.cpp:301–308  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

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())

Callers

nothing calls this directly

Calls 1

sqrtFunction · 0.50

Tested by

no test coverage detected