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

Method post

test/int/distinct.cpp:71–82  ·  view source on GitHub ↗

Post constraint on \a x

Source from the content-addressed store, hash-verified

69 }
70 /// Post constraint on \a x
71 virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
72 if (!useCount) {
73 Gecode::distinct(home, x, ipl);
74 } else {
75 Gecode::IntSetRanges dr(dom);
76 int i = 0;
77 Gecode::IntArgs ia(Gecode::Iter::Ranges::size(dr));
78 for (Gecode::IntSetValues dr2(dom); dr2(); ++dr2)
79 ia[i++] = dr2.val();
80 Gecode::count(home, x, Gecode::IntSet(0,1), ia, ipl);
81 }
82 }
83 };
84
85 /// Simple test for distinct constraint with offsets

Callers

nothing calls this directly

Calls 5

distinctFunction · 0.85
IntSetClass · 0.85
sizeFunction · 0.50
countFunction · 0.50
valMethod · 0.45

Tested by

no test coverage detected