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

Method solution

test/set/precede.cpp:70–79  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

68 s(s0), t(t0) {}
69 /// %Test whether \a x is solution
70 virtual bool solution(const SetAssignment& x) const {
71 int n = x.size();
72 for (int i = 0 ; i < n ; i++) {
73 if (!in(s,x[i]) && in(t,x[i]))
74 return false;
75 if (in(s,x[i]) && !in(t,x[i]))
76 return true;
77 }
78 return true;
79 }
80 /// Post constraint on \a x
81 virtual void post(Gecode::Space& home, Gecode::SetVarArray& x,
82 Gecode::IntVarArray&) {

Callers

nothing calls this directly

Calls 2

inFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected