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

Method solution

test/int/sequence.cpp:66–79  ·  view source on GitHub ↗

%Test whether \a x is solutionin

Source from the content-addressed store, hash-verified

64 }
65 /// %Test whether \a x is solutionin
66 virtual bool solution(const Assignment& x) const {
67 for (int i=0; i< (x.size() - q + 1); i++ ) {
68 int total = 0;
69 for (int j=i; j < i + q; j++ ) {
70 if (s.in(x[j]))
71 total++;
72 if (total > u)
73 return false;
74 }
75 if ( total < l )
76 return false;
77 }
78 return true;
79 }
80 };
81
82

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
inMethod · 0.45

Tested by

no test coverage detected