MCPcopy Create free account
hub / github.com/Gecode/gecode / post

Method post

gecode/int/cumulative/man-prop.hpp:53–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52 template<class ManTask, class Cap, class PL>
53 ExecStatus
54 ManProp<ManTask,Cap,PL>::post(Home home, Cap c, TaskArray<ManTask>& t) {
55 // Capacity must be nonnegative
56 GECODE_ME_CHECK(c.gq(home, 0));
57 // Check that tasks do not overload resource
58 for (int i=0; i<t.size(); i++)
59 if (t[i].c() > c.max())
60 return ES_FAILED;
61 if (t.size() == 1)
62 GECODE_ME_CHECK(c.gq(home, t[0].c()));
63 if (t.size() > 1) {
64 if (c.assigned() && c.val()==1) {
65 TaskArray<typename TaskTraits<ManTask>::UnaryTask> mt(home,t.size());
66 for (int i=0; i<t.size(); i++)
67 mt[i]=t[i];
68 return Unary::ManProp<typename TaskTraits<ManTask>::UnaryTask,PL>
69 ::post(home,mt);
70 } else {
71 (void) new (home) ManProp<ManTask,Cap,PL>(home,c,t);
72 }
73 }
74 return ES_OK;
75 }
76
77 template<class ManTask, class Cap, class PL>
78 Actor*

Callers

nothing calls this directly

Calls 7

postFunction · 0.50
gqMethod · 0.45
sizeMethod · 0.45
cMethod · 0.45
maxMethod · 0.45
assignedMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected