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

Method solution

test/set/element.cpp:324–331  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

322 : SetTest(t,1,ds_13,false,true), i0(-3,-3), i1(-1,1), i2(0,2) {}
323 /// %Test whether \a x is solution
324 virtual bool solution(const SetAssignment& x) const {
325 if (x.intval() < 0 || x.intval() > 2)
326 return false;
327 CountableSetRanges xr(x.lub, x[0]);
328 IntSet iss[] = {i0, i1, i2};
329 IntSetRanges isr(iss[x.intval()]);
330 return Iter::Ranges::equal(xr, isr);
331 }
332 /// Post constraint on \a x
333 virtual void post(Space& home, SetVarArray& x, IntVarArray& y) {
334 IntSetArgs xs(3);

Callers

nothing calls this directly

Calls 2

intvalMethod · 0.80
equalFunction · 0.50

Tested by

no test coverage detected