| 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 |
no test coverage detected