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

Method solution

test/set/dom.cpp:465–473  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

463 : SetTest("Dom::CardRange::"+str(n),n,d1,false) {}
464 /// %Test whether \a x is solution
465 virtual bool solution(const SetAssignment& x) const {
466 for (int i=x.size(); i--; ) {
467 CountableSetRanges xr(x.lub, x[i]);
468 unsigned int card = Iter::Ranges::size(xr);
469 if ((card < 2) || (card > 3))
470 return false;
471 }
472 return true;
473 }
474 /// Post constraint on \a x
475 virtual void post(Space& home, SetVarArray& x, IntVarArray&) {
476 if (x.size() == 1)

Callers

nothing calls this directly

Calls 2

sizeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected