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

Method post

gecode/int/unary/opt-prop.hpp:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48 template<class OptTask, class PL>
49 ExecStatus
50 OptProp<OptTask,PL>::post(Home home, TaskArray<OptTask>& t) {
51 int m=0, o=0;
52 for (int i=0; i<t.size(); i++) {
53 if (t[i].mandatory())
54 m++;
55 else if (t[i].optional())
56 o++;
57 }
58 if (m == t.size()) {
59 TaskArray<typename TaskTraits<OptTask>::ManTask> mt(home,m);
60 for (int i=0; i<m; i++)
61 mt[i].init(t[i]);
62 return ManProp<typename TaskTraits<OptTask>::ManTask,PL>::post(home,mt);
63 }
64 if (o+m > 1)
65 (void) new (home) OptProp<OptTask,PL>(home,t);
66 return ES_OK;
67 }
68
69 template<class OptTask, class PL>
70 Actor*

Callers

nothing calls this directly

Calls 5

postFunction · 0.50
sizeMethod · 0.45
mandatoryMethod · 0.45
optionalMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected