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

Method propagate

gecode/int/channel/val.hpp:198–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197 template<class View, class Offset, bool shared>
198 ExecStatus
199 Val<View,Offset,shared>::propagate(Space& home, const ModEventDelta&) {
200 Region r;
201 ProcessStack xa(r,n);
202 ProcessStack ya(r,n);
203
204 ValInfo<View>* x = xy;
205 ValInfo<View>* y = xy+n;
206
207 // Scan x and y for assigned but not yet propagated views
208 for (int i=0; i<n; i++) {
209 if (x[i].doval()) xa.push(i);
210 if (y[i].doval()) ya.push(i);
211 }
212
213 do {
214 // Propagate assigned views for x
215 GECODE_ES_CHECK((prop_val<View,Offset,ValInfo<View> >
216 (home,n,x,ox,y,oy,n_na,xa,ya)));
217 // Propagate assigned views for y
218 GECODE_ES_CHECK((prop_val<View,Offset,ValInfo<View> >
219 (home,n,y,oy,x,ox,n_na,ya,xa)));
220 assert(ya.empty());
221 } while (!xa.empty());
222
223 if (n_na == 0)
224 return home.ES_SUBSUMED(*this);
225 return shared ? ES_NOFIX : ES_FIX;
226 }
227
228 template<class View, class Offset, bool shared>
229 ExecStatus

Callers

nothing calls this directly

Calls 4

ES_SUBSUMEDMethod · 0.80
dovalMethod · 0.45
pushMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected