49 for (
int i=0;
i<in.
size();
i++) {
57 template<
class In>
class ViewType;
62 typedef Int::ConstIntView Result;
68 typedef Int::IntView Result;
71 template<
class Machine,
class Processing,
class Usage>
73 post_cumulatives(
Home home,
const Machine& m,
78 if (m.size() != s.size() ||
79 s.size() != p.size() ||
80 p.size() != e.size() ||
86 vm = make_view_array(home, m);
88 vp = make_view_array(home, p);
90 vu = make_view_array(home, u);
92 vs = make_view_array(home, s),
93 ve = make_view_array(home, e);
96 for (
int i=0;
i<
c.size();
i++)
101 typename ViewType<Machine>::Result,
102 typename ViewType<Processing>::Result,
103 typename ViewType<Usage>::Result,
113 const IntArgs& c,
bool at_most,
115 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
122 const IntArgs& c,
bool at_most,
124 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
131 const IntArgs& c,
bool at_most,
133 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
140 const IntArgs& c,
bool at_most,
142 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
149 const IntArgs& c,
bool at_most,
151 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
158 const IntArgs& c,
bool at_most,
160 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
167 const IntArgs& c,
bool at_most,
169 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
176 const IntArgs& c,
bool at_most,
178 post_cumulatives(home, m, s, p, e, u, c, at_most, cl);
int size(void) const
Return size of array (number of elements).
Home class for posting propagators
Passing integer arguments.
Passing integer variables.
Exception: Arguments are of different size
Propagator for the cumulatives constraint
Integer view for integer variables.
Shared array with arbitrary number of elements.
#define GECODE_POST
Check for failure in a constraint post function.
#define GECODE_ES_FAIL(es)
Check whether execution status es is failed, and fail space home.
IntPropLevel
Propagation levels for integer propagators.
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Gecode toplevel namespace
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 ipl=IPL_DEF)
Post propagators for the cumulatives constraint.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
Gecode::IntArgs i({1, 2, 3, 4})