| 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 | |