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

Method solution

test/set/int.cpp:137–141  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

135 : SetTest(t,1,ds_33,true,1) {}
136 /// %Test whether \a x is solution
137 virtual bool solution(const SetAssignment& x) const {
138 CountableSetRanges xr0(x.lub, x[0]);
139 IntSet x0(xr0);
140 return x0.ranges() > 0 && x0.max()==x.intval();
141 }
142 /// Post constraint on \a x
143 virtual void post(Space& home, SetVarArray& x, IntVarArray& y) {
144 Gecode::max(home, x[0], y[0]);

Callers

nothing calls this directly

Calls 3

intvalMethod · 0.80
rangesMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected