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

Method solution

test/int/element.cpp:491–499  ·  view source on GitHub ↗

%Test whether \a x is solution

Source from the content-addressed store, hash-verified

489 : Test("Element::Matrix::BoolVar::BoolVar::XX",2+4,0,1,false) {}
490 /// %Test whether \a x is solution
491 virtual bool solution(const Assignment& x) const {
492 // x-coordinate: x[0], y-coordinate: x[0], result: x[1]
493 // remaining: matrix
494 using namespace Gecode;
495 IntArgs tm(4);
496 tm[0]=x[2]; tm[1]=x[3]; tm[2]=x[4]; tm[3]=x[5];
497 Matrix<IntArgs> m(tm,2,2);
498 return m(x[0],x[0]) == x[1];
499 }
500 /// Post constraint on \a x
501 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
502 // x-coordinate: x[0], y-coordinate: x[1], result: x[1]

Callers

nothing calls this directly

Calls 1

mFunction · 0.85

Tested by

no test coverage detected