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

Method prune

gecode/int/distinct/graph.hpp:239–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238 template<class View>
239 forceinline ExecStatus
240 Graph<View>::prune(Space& home, bool& assigned) {
241 using namespace ViewValGraph;
242 // Tell constraints and also eliminate nodes and edges
243 for (int i = n_view; i--; ) {
244 ViewNode<View>* x = view[i];
245 if (!x->edge_fst()->used(x)) {
246 GECODE_ME_CHECK(x->view().eq(home,x->edge_fst()->val(x)->val()));
247 x->edge_fst()->val(x)->matching(nullptr);
248 for (Edge<View>* e = x->val_edges(); e != nullptr; e = e->next_edge())
249 e->unlink();
250 view[i] = view[--n_view];
251 assigned = true;
252 } else {
253 IterPruneVal<View> pv(view[i]);
254 GECODE_ME_CHECK(view[i]->view().minus_v(home,pv,false));
255 }
256 }
257 return ES_OK;
258 }
259
260}}}
261

Callers 1

propagateMethod · 0.45

Calls 10

edge_fstMethod · 0.80
matchingMethod · 0.80
val_edgesMethod · 0.80
next_edgeMethod · 0.80
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