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

Method solution

test/int/element.cpp:325–332  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

323 tm({0,1,2,3}) {}
324 /// %Test whether \a x is solution
325 virtual bool solution(const Assignment& x) const {
326 // x-coordinate: x[0], y-coordinate: x[0], result: x[1]
327 using namespace Gecode;
328 if (x[0] > 1)
329 return false;
330 Matrix<IntArgs> m(tm,2,2);
331 return m(x[0],x[0]) == x[1];
332 }
333 /// Post constraint on \a x
334 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
335 // x-coordinate: x[0], y-coordinate: x[0], result: x[1]

Callers

nothing calls this directly

Calls 1

mFunction · 0.85

Tested by

no test coverage detected