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

Method propagate

gecode/set/channel/bool.hpp:153–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152 template<class View>
153 ExecStatus
154 ChannelBool<View>::propagate(Space& home, const ModEventDelta&) {
155 running = true;
156 if (zeros.size() > 0) {
157 BndSetRanges zi(zeros);
158 GECODE_ME_CHECK(y.excludeI(home, zi));
159 zeros.init(home);
160 }
161 if (ones.size() > 0) {
162 BndSetRanges oi(ones);
163 GECODE_ME_CHECK(y.includeI(home, oi));
164 ones.init(home);
165 }
166 running = false;
167
168 if (delta.glbMin() != 1 || delta.glbMax() != 0) {
169 if (!delta.glbAny()) {
170 for (int i=delta.glbMin(); i<=delta.glbMax(); i++)
171 GECODE_ME_CHECK(x[i].one(home));
172 } else {
173 GlbRanges<View> glb(y);
174 for (Iter::Ranges::ToValues<GlbRanges<View> > gv(glb); gv(); ++gv) {
175 GECODE_ME_CHECK(x[gv.val()].one(home));
176 }
177 }
178 }
179 if (delta.lubMin() != 1 || delta.lubMax() != 0) {
180 if (!delta.lubAny()) {
181 for (int i=delta.lubMin(); i<=delta.lubMax(); i++)
182 GECODE_ME_CHECK(x[i].zero(home));
183 } else {
184 int cur = 0;
185 for (LubRanges<View> lub(y); lub(); ++lub) {
186 for (; cur < lub.min(); cur++) {
187 GECODE_ME_CHECK(x[cur].zero(home));
188 }
189 cur = lub.max() + 1;
190 }
191 for (; cur < x.size(); cur++) {
192 GECODE_ME_CHECK(x[cur].zero(home));
193 }
194 }
195 }
196
197 new (&delta) SetDelta();
198
199 return y.assigned() ? home.ES_SUBSUMED(*this) : ES_FIX;
200 }
201
202 template<class View>
203 ExecStatus

Callers

nothing calls this directly

Calls 15

ES_SUBSUMEDMethod · 0.80
sizeMethod · 0.45
excludeIMethod · 0.45
initMethod · 0.45
includeIMethod · 0.45
glbMinMethod · 0.45
glbMaxMethod · 0.45
glbAnyMethod · 0.45
oneMethod · 0.45
valMethod · 0.45
lubMinMethod · 0.45
lubMaxMethod · 0.45

Tested by

no test coverage detected