46 make_view_array(Space& home,
const IntVarArgs& in) {
47 return ViewArray<Int::IntView>(home, in);
50 ViewArray<ConstIntView>
51 make_view_array(Space& home,
const IntArgs& in) {
52 ViewArray<Int::ConstIntView> res(home, in.size());
53 for (
int i = in.size();
i--; ) {
55 res[
i] = Int::ConstIntView(in[
i]);
61 template<
class In>
class ViewType;
64 class ViewType<IntArgs> {
66 typedef Int::ConstIntView Result;
70 class ViewType<IntVarArgs> {
72 typedef Int::IntView Result;
75 template<
class Machine,
class Processing,
class Usage>
77 post_cumulatives(Home home,
const Machine& m,
78 const IntVarArgs& s,
const Processing&
p,
79 const IntVarArgs& e,
const Usage&
u,
80 const IntArgs&
c,
bool at_most,
82 if (m.size() != s.size() ||
83 s.size() !=
p.size() ||
84 p.size() != e.size() ||
86 throw Int::ArgumentSizeMismatch(
"Int::cumulatives");
89 ViewArray<typename ViewType<Machine>::Result>
90 vm = make_view_array(home, m);
91 ViewArray<typename ViewType<Processing>::Result>
92 vp = make_view_array(home,
p);
93 ViewArray<typename ViewType<Usage>::Result>
94 vu = make_view_array(home,
u);
96 vs = make_view_array(home, s),
97 ve = make_view_array(home, e);
99 SharedArray<int> c_s(
c.
size());
105 typename ViewType<Machine>::Result,
106 typename ViewType<Processing>::Result,
107 typename ViewType<Usage>::Result,
108 IntView>::
post(home, vm,vs,vp,ve,vu,c_s,at_most)));
119 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
128 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
137 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
146 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
155 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
164 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
173 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
182 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);