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

Method solution

test/int/extensional.cpp:458–470  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

456 }
457 /// %Test whether \a x is solution
458 virtual bool solution(const Assignment& x) const {
459 using namespace Gecode;
460 for (int i=ts.tuples(); i--; ) {
461 TupleSet::Tuple t = ts[i];
462 bool same = true;
463 for (int j=0; (j < ts.arity()) && same; j++)
464 if (t[j] != x[j])
465 same = false;
466 if (same)
467 return pos;
468 }
469 return !pos;
470 }
471 /// Post constraint on \a x
472 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
473 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

tuplesMethod · 0.80
arityMethod · 0.80

Tested by

no test coverage detected