| 37 | |
| 38 | template<class ManTaskView> |
| 39 | forceinline ExecStatus |
| 40 | notlast(Space& home, TaskViewArray<ManTaskView>& t) { |
| 41 | sort<ManTaskView,STO_LCT,true>(t); |
| 42 | |
| 43 | Region r; |
| 44 | |
| 45 | OmegaTree<ManTaskView> o(r,t); |
| 46 | TaskViewIter<ManTaskView,STO_LST,true> q(r,t); |
| 47 | int* lct = r.alloc<int>(t.size()); |
| 48 | |
| 49 | for (int i=0; i<t.size(); i++) |
| 50 | lct[i] = t[i].lct(); |
| 51 | |
| 52 | for (int i=0; i<t.size(); i++) { |
| 53 | int j = -1; |
| 54 | while (q() && (t[i].lct() > t[q.task()].lst())) { |
| 55 | if ((j >= 0) && (o.ect() > t[q.task()].lst())) |
| 56 | lct[q.task()] = std::min(lct[q.task()],t[j].lst()); |
| 57 | j = q.task(); |
| 58 | o.insert(j); ++q; |
| 59 | } |
| 60 | if ((j >= 0) && (o.ect(i) > t[i].lst())) |
| 61 | lct[i] = std::min(lct[i],t[j].lst()); |
| 62 | } |
| 63 | |
| 64 | for (int i=0; i<t.size(); i++) |
| 65 | GECODE_ME_CHECK(t[i].lct(home,lct[i])); |
| 66 | |
| 67 | return ES_OK; |
| 68 | } |
| 69 | |
| 70 | template<class ManTask> |
| 71 | ExecStatus |