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);
int size(void) const
Return size of array (number of elements)
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Passing integer variables.
Passing integer arguments.
IntPropLevel
Propagation levels for integer propagators.
Gecode toplevel namespace
FloatNum size(void) const
Return size of float value (distance between maximum and minimum)
#define GECODE_POST
Check for failure in a constraint post function.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Home class for posting propagators
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
void cumulatives(Home home, const IntVarArgs &m, const IntVarArgs &s, const IntVarArgs &p, const IntVarArgs &e, const IntVarArgs &u, const IntArgs &c, bool at_most, IntPropLevel cl)
Post propagators for the cumulatives constraint.