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

Method solution

test/int/extensional.cpp:529–540  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

527 }
528 /// %Test whether \a x is solution
529 virtual bool solution(const Assignment& x) const {
530 using namespace Gecode;
531 for (int i = 0; i < t.tuples(); ++i) {
532 TupleSet::Tuple l = t[i];
533 bool same = true;
534 for (int j = 0; j < t.arity() && same; ++j)
535 if (l[j] != x[j]) same = false;
536 if (same)
537 return pos;
538 }
539 return !pos;
540 }
541 /// Post constraint on \a x
542 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
543 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

tuplesMethod · 0.80
arityMethod · 0.80

Tested by

no test coverage detected