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

Method post

gecode/int/dom/range.hpp:45–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44 template<class View, ReifyMode rm>
45 ExecStatus
46 ReRange<View,rm>::post(Home home, View x, int min, int max, BoolView b) {
47 if (min == max) {
48 return Rel::ReEqDomInt<View,BoolView,rm>::post(home,x,min,b);
49 } else if ((min > max) || (max < x.min()) || (min > x.max())) {
50 if (rm == RM_PMI)
51 return ES_OK;
52 GECODE_ME_CHECK(b.zero(home));
53 } else if ((min <= x.min()) && (x.max() <= max)) {
54 if (rm == RM_IMP)
55 return ES_OK;
56 GECODE_ME_CHECK(b.one(home));
57 } else if (b.one()) {
58 if (rm == RM_PMI)
59 return ES_OK;
60 GECODE_ME_CHECK(x.gq(home,min));
61 GECODE_ME_CHECK(x.lq(home,max));
62 } else if (b.zero()) {
63 if (rm == RM_IMP)
64 return ES_OK;
65 Iter::Ranges::Singleton r(min,max);
66 GECODE_ME_CHECK(x.minus_r(home,r,false));
67 } else {
68 (void) new (home) ReRange<View,rm>(home,x,min,max,b);
69 }
70 return ES_OK;
71 }
72
73
74 template<class View, ReifyMode rm>

Callers

nothing calls this directly

Calls 8

postFunction · 0.50
minMethod · 0.45
maxMethod · 0.45
zeroMethod · 0.45
oneMethod · 0.45
gqMethod · 0.45
lqMethod · 0.45
minus_rMethod · 0.45

Tested by

no test coverage detected