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

Method prune

gecode/int/nvalues/graph.hpp:254–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252 }
253
254 forceinline ExecStatus
255 Graph::prune(Space& home) {
256 using namespace ViewValGraph;
257 // Tell constraints and also eliminate nodes and edges
258 for (int i = n_view; i--; ) {
259 ViewNode<IntView>* x = view[i];
260 if (!x->fake()) {
261 if (x->matched() && !x->edge_fst()->used(x)) {
262 GECODE_ME_CHECK(x->view().eq(home,x->edge_fst()->val(x)->val()));
263 x->edge_fst()->val(x)->matching(nullptr);
264 for (Edge<IntView>* e = x->val_edges(); e != nullptr; e=e->next_edge())
265 e->unlink();
266 view[i] = view[--n_view];
267 } else {
268 IterPruneVal<IntView> pv(x);
269 GECODE_ME_CHECK(x->view().minus_v(home,pv,false));
270 }
271 }
272 }
273
274 return ES_OK;
275 }
276
277}}}
278

Callers 1

prune_upperMethod · 0.45

Calls 12

fakeMethod · 0.80
edge_fstMethod · 0.80
matchingMethod · 0.80
val_edgesMethod · 0.80
next_edgeMethod · 0.80
matchedMethod · 0.45
usedMethod · 0.45
eqMethod · 0.45
viewMethod · 0.45
valMethod · 0.45
unlinkMethod · 0.45
minus_vMethod · 0.45

Tested by

no test coverage detected