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

Method post

test/set/distinct.cpp:96–104  ·  view source on GitHub ↗

Post constraint on \a x

Source from the content-addressed store, hash-verified

94 }
95 /// Post constraint on \a x
96 virtual void post(Space& home, SetVarArray& x, IntVarArray&) {
97 SetVar s1(home, IntSet::empty, -2, 2, 0U, 1U);
98 Gecode::rel(home, x[0], SOT_INTER, x[1], SRT_EQ, s1);
99 SetVar s2(home, IntSet::empty, -2, 2, 0U, 1U);
100 Gecode::rel(home, x[0], SOT_INTER, x[2], SRT_EQ, s2);
101 SetVar s3(home, IntSet::empty, -2, 2, 0U, 1U);
102 Gecode::rel(home, x[1], SOT_INTER, x[2], SRT_EQ, s3);
103 Gecode::atmostOne(home, x, 3);
104 }
105 };
106 AtmostOne _atmostone("Distinct::AtmostOne");
107

Callers

nothing calls this directly

Calls 2

atmostOneFunction · 0.85
relFunction · 0.50

Tested by

no test coverage detected