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

Method solution

test/int/bool.cpp:350–361  ·  view source on GitHub ↗

Check whether \a x is solution

Source from the content-addressed store, hash-verified

348 op(op0) {}
349 /// Check whether \a x is solution
350 virtual bool solution(const Assignment& x) const {
351 int n = x.size() / 2;
352 int b;
353 if (n == 1) {
354 b = check(x[0],op,!x[1]);
355 } else {
356 b = check(x[0],op,!x[n]);
357 for (int i=1; i<n; i++)
358 b = check(b,op,check(x[i],op,!x[n+i]));
359 }
360 return b == x[0];
361 }
362 /// Post constraint
363 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
364 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

checkFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected