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

Function post_cumulatives

gecode/int/cumulatives.cpp:72–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71 template<class Machine, class Processing, class Usage>
72 void
73 post_cumulatives(Home home, const Machine& m,
74 const IntVarArgs& s, const Processing& p,
75 const IntVarArgs& e, const Usage& u,
76 const IntArgs& c, bool at_most,
77 IntPropLevel) {
78 if (m.size() != s.size() ||
79 s.size() != p.size() ||
80 p.size() != e.size() ||
81 e.size() != u.size())
82 throw Int::ArgumentSizeMismatch("Int::cumulatives");
83 GECODE_POST;
84
85 ViewArray<typename ViewType<Machine>::Result>
86 vm = make_view_array(home, m);
87 ViewArray<typename ViewType<Processing>::Result>
88 vp = make_view_array(home, p);
89 ViewArray<typename ViewType<Usage>::Result>
90 vu = make_view_array(home, u);
91 ViewArray<IntView>
92 vs = make_view_array(home, s),
93 ve = make_view_array(home, e);
94
95 SharedArray<int> c_s(c.size());
96 for (int i=0; i<c.size(); i++)
97 c_s[i] = c[i];
98
99 // There is only the value-consistent propagator for this constraint
100 GECODE_ES_FAIL((Int::Cumulatives::Val<
101 typename ViewType<Machine>::Result,
102 typename ViewType<Processing>::Result,
103 typename ViewType<Usage>::Result,
104 IntView>::post(home, vm,vs,vp,ve,vu,c_s,at_most)));
105
106 }
107 }
108
109 void

Callers 1

cumulativesFunction · 0.85

Calls 3

make_view_arrayFunction · 0.85
postFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected