| 75 | |
| 76 | template<class View, class Offset> |
| 77 | ExecStatus |
| 78 | Dom<View,Offset>::propagate(Space& home, const ModEventDelta& med) { |
| 79 | if (View::me(med) == Int::ME_INT_VAL) { |
| 80 | GECODE_ES_CHECK((Int::Distinct::prop_val<View,true>(home,y))); |
| 81 | ExecStatus escv = connected(home); |
| 82 | if (escv != ES_FIX) |
| 83 | return escv; |
| 84 | if (y.size() < 2) |
| 85 | return home.ES_SUBSUMED(*this); |
| 86 | return home.ES_FIX_PARTIAL(*this,View::med(Int::ME_INT_DOM)); |
| 87 | } |
| 88 | |
| 89 | if (dc.available()) { |
| 90 | GECODE_ES_CHECK(dc.sync()); |
| 91 | } else { |
| 92 | GECODE_ES_CHECK(dc.init(home,y)); |
| 93 | } |
| 94 | bool assigned; |
| 95 | GECODE_ES_CHECK(dc.propagate(home,assigned)); |
| 96 | |
| 97 | ExecStatus esc = connected(home); |
| 98 | if (esc != ES_FIX) |
| 99 | return esc; |
| 100 | |
| 101 | // Eliminate assigned views from y, as they have been assigned |
| 102 | // and propagated by domain consistent propagation. This is required |
| 103 | // as we need to know how many assigned views actually exist. |
| 104 | if (assigned) |
| 105 | for (int i=y.size(); i--; ) |
| 106 | if (y[i].assigned()) |
| 107 | y.move_lst(i); |
| 108 | |
| 109 | return path(home); |
| 110 | } |
| 111 | |
| 112 | template<class View, class Offset> |
| 113 | ExecStatus |
nothing calls this directly
no test coverage detected