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

Method unwind

gecode/search/par/path.hpp:209–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207
208 template<class Tracer>
209 forceinline void
210 Path<Tracer>::unwind(int l, Tracer& t) {
211 assert((ds[l].space() == nullptr) || ds[l].space()->failed());
212 int n = ds.entries();
213 if (t) {
214 for (int i=l; i<n; i++) {
215 Path<Tracer>::Edge& top = ds.top();
216 unsigned int fa = (i != l) ? top.alt() + 1 : top.alt();
217 for (unsigned int a = fa; a < top.choice()->alternatives(); a++) {
218 SearchTracer::EdgeInfo ei(t.wid(), top.nid(), a);
219 t.skip(ei);
220 }
221 if (ds.top().work())
222 n_work--;
223 ds.pop().dispose();
224 }
225 } else {
226 for (int i=l; i<n; i++) {
227 if (ds.top().work())
228 n_work--;
229 ds.pop().dispose();
230 }
231 }
232 assert(ds.entries() == l);
233 }
234
235 template<class Tracer>
236 forceinline void

Callers

nothing calls this directly

Calls 12

alternativesMethod · 0.80
workMethod · 0.80
spaceMethod · 0.45
failedMethod · 0.45
entriesMethod · 0.45
altMethod · 0.45
choiceMethod · 0.45
widMethod · 0.45
nidMethod · 0.45
skipMethod · 0.45
disposeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected