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

Method solution

test/int/mm-lin.cpp:129–135  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

127 }
128 /// %Test whether \a x is solution
129 virtual bool solution(const Assignment& x) const {
130 for (int i=3; i--; )
131 if ((x[i] < 0) || (x[i] > 1))
132 return false;
133 int reg[3] = {x[0],x[1],x[2]};
134 return eval(lis, reg) == x[3];
135 }
136 /// Post constraint on \a x
137 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
138 using namespace Gecode;

Callers

nothing calls this directly

Calls 1

evalFunction · 0.70

Tested by

no test coverage detected