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

Method solution

test/int/bool.cpp:256–262  ·  view source on GitHub ↗

Check whether \a x is solution

Source from the content-addressed store, hash-verified

254 }
255 /// Check whether \a x is solution
256 virtual bool solution(const Assignment& x) const {
257 int n = x.size();
258 int b = check(x[n-2],op,x[n-1]);
259 for (int i=0; i<n-2; i++)
260 b = check(x[i],op,b);
261 return b == x[n-1];
262 }
263 /// Post constraint
264 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
265 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

checkFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected