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

Method solution

test/set/element.cpp:296–302  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

294 : SetTest(t,4,ds_12,false,true) {}
295 /// %Test whether \a x is solution
296 virtual bool solution(const SetAssignment& x) const {
297 if (x.intval() < 0 || x.intval() > 2)
298 return false;
299 CountableSetRanges z(x.lub, x[3]);
300 CountableSetRanges y(x.lub, x[x.intval()]);
301 return Iter::Ranges::equal(y, z);
302 }
303 /// Post constraint on \a x
304 virtual void post(Space& home, SetVarArray& x, IntVarArray& y) {
305 SetVarArgs xs(x.size()-1);

Callers

nothing calls this directly

Calls 2

intvalMethod · 0.80
equalFunction · 0.50

Tested by

no test coverage detected