42 make_view_array(Space& home,
const IntVarArgs& in) {
43 return ViewArray<Int::IntView>(home, in);
46 ViewArray<ConstIntView>
47 make_view_array(Space& home,
const IntArgs& in) {
48 ViewArray<Int::ConstIntView> res(home, in.size());
49 for (
int i=0;
i<in.size();
i++) {
51 res[
i] = Int::ConstIntView(in[
i]);
57 template<
class In>
class ViewType;
60 class ViewType<IntArgs> {
62 typedef Int::ConstIntView Result;
66 class ViewType<IntVarArgs> {
68 typedef Int::IntView Result;
71 template<
class Machine,
class Processing,
class Usage>
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,
78 if (m.size() != s.size() ||
79 s.size() !=
p.size() ||
80 p.size() != e.size() ||
82 throw Int::ArgumentSizeMismatch(
"Int::cumulatives");
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);
92 vs = make_view_array(home, s),
93 ve = make_view_array(home, e);
95 SharedArray<int> c_s(
c.
size());
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)));
115 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
124 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
133 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
142 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
151 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
160 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
169 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);
178 post_cumulatives(home, m, s,
p, e,
u,
c, at_most, cl);