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

Method solution

test/int/extensional.cpp:580–592  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

578 }
579 /// %Test whether \a x is solution
580 virtual bool solution(const Assignment& x) const {
581 using namespace Gecode;
582 for (int i = 0; i < t.tuples(); ++i) {
583 TupleSet::Tuple l = t[i];
584 bool same = true;
585 for (int j = 0; j < t.arity() && same; ++j)
586 if (l[j] != x[j])
587 same = false;
588 if (same)
589 return pos;
590 }
591 return !pos;
592 }
593 /// Post constraint on \a x
594 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
595 using namespace Gecode;

Callers

nothing calls this directly

Calls 2

tuplesMethod · 0.80
arityMethod · 0.80

Tested by

no test coverage detected