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

Method solution

test/int/arithmetic.cpp:410–414  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

408 : Test("Arithmetic::DivMod::"+s,4,d) {}
409 /// %Test whether \a x is solution
410 virtual bool solution(const Assignment& x) const {
411 return x[0] == x[1]*x[2]+x[3] &&
412 abs(x[3]) < abs(x[1]) &&
413 (x[3] == 0 || sgn(x[3]) == sgn(x[0]));
414 }
415 /// Post constraint on \a x
416 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
417 Gecode::divmod(home, x[0], x[1], x[2], x[3]);

Callers

nothing calls this directly

Calls 1

absFunction · 0.50

Tested by

no test coverage detected