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

Method propagate

gecode/int/dom/range.hpp:87–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86 template<class View, ReifyMode rm>
87 ExecStatus
88 ReRange<View,rm>::propagate(Space& home, const ModEventDelta&) {
89 if (b.one()) {
90 if (rm != RM_PMI) {
91 GECODE_ME_CHECK(x0.gq(home,min));
92 GECODE_ME_CHECK(x0.lq(home,max));
93 }
94 return home.ES_SUBSUMED(*this);
95 } else if (b.zero()) {
96 if (rm != RM_IMP) {
97 Iter::Ranges::Singleton r(min,max);
98 GECODE_ME_CHECK(x0.minus_r(home,r,false));
99 }
100 return home.ES_SUBSUMED(*this);
101 } else if ((x0.max() <= max) && (x0.min() >= min)) {
102 if (rm != RM_IMP)
103 GECODE_ME_CHECK(b.one_none(home));
104 return home.ES_SUBSUMED(*this);
105 } else if ((x0.max() < min) || (x0.min() > max)) {
106 if (rm != RM_PMI)
107 GECODE_ME_CHECK(b.zero_none(home));
108 return home.ES_SUBSUMED(*this);
109 } else if (!x0.range()) {
110 ViewRanges<View> i_x(x0);
111 Iter::Ranges::Singleton i_mm(min,max);
112
113 switch (Iter::Ranges::compare(i_x,i_mm)) {
114 case Iter::Ranges::CS_SUBSET:
115 if (rm != RM_IMP)
116 GECODE_ME_CHECK(b.one_none(home));
117 return home.ES_SUBSUMED(*this);
118 case Iter::Ranges::CS_DISJOINT:
119 if (rm != RM_PMI)
120 GECODE_ME_CHECK(b.zero_none(home));
121 return home.ES_SUBSUMED(*this);
122 case Iter::Ranges::CS_NONE:
123 break;
124 default: GECODE_NEVER;
125 }
126 return ES_FIX;
127 }
128 return ES_FIX;
129 }
130
131}}}
132

Callers

nothing calls this directly

Calls 11

ES_SUBSUMEDMethod · 0.80
oneMethod · 0.45
gqMethod · 0.45
lqMethod · 0.45
zeroMethod · 0.45
minus_rMethod · 0.45
maxMethod · 0.45
minMethod · 0.45
one_noneMethod · 0.45
zero_noneMethod · 0.45
rangeMethod · 0.45

Tested by

no test coverage detected