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

Method solution

test/int/bool.cpp:286–292  ·  view source on GitHub ↗

Check whether \a x is solution

Source from the content-addressed store, hash-verified

284 op(op0), c(c0) {}
285 /// Check whether \a x is solution
286 virtual bool solution(const Assignment& x) const {
287 int n = x.size();
288 int b = check(x[n-2],op,x[n-1]);
289 for (int i=0; i<n-2; i++)
290 b = check(x[i],op,b);
291 return b == c;
292 }
293 /// Post constraint
294 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
295 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

checkFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected