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

Method solution

test/set/int.cpp:436–440  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

434 elements(el), weights(w), minWeight(min), maxWeight(max) {}
435 /// %Test whether \a x is solution
436 virtual bool solution(const SetAssignment& x) const {
437 CountableSetRanges x0(x.lub, x[0]);
438 return x.intval()==weightI(elements,weights,x0) &&
439 x.intval() >= minWeight && x.intval() <= maxWeight;
440 }
441 /// Post constraint on \a x
442 virtual void post(Space& home, SetVarArray& x, IntVarArray& y) {
443 Gecode::rel(home, minWeight <= y[0]);

Callers

nothing calls this directly

Calls 2

intvalMethod · 0.80
weightIFunction · 0.70

Tested by

no test coverage detected