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

Method solution

test/float/arithmetic.cpp:356–363  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

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]);

Callers

nothing calls this directly

Calls 1

sqrtFunction · 0.50

Tested by

no test coverage detected