MCPcopy Create free account
hub / github.com/Gecode/gecode / ExecStatus notlast

Function ExecStatus notlast

gecode/int/unary/not-first-not-last.hpp:39–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

taskMethod · 0.80
ES_SUBSUMEDMethod · 0.80
minFunction · 0.50
sizeMethod · 0.45
lctMethod · 0.45
lstMethod · 0.45
ectMethod · 0.45
insertMethod · 0.45
mandatoryMethod · 0.45
excludedMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected