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

Method solution

test/int/element.cpp:381–388  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

379 tm({0,1,1,0}) {}
380 /// %Test whether \a x is solution
381 virtual bool solution(const Assignment& x) const {
382 // x-coordinate: x[0], y-coordinate: x[0], result: x[1]
383 using namespace Gecode;
384 if (x[0] > 1)
385 return false;
386 Matrix<IntArgs> m(tm,2,2);
387 return m(x[0],x[0]) == x[1];
388 }
389 /// Post constraint on \a x
390 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
391 // 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