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

Method incr_sum

examples/radiotherapy.cpp:164–173  ·  view source on GitHub ↗

Post incremental sum constraint

Source from the content-addressed store, hash-verified

162
163 /// Post incremental sum constraint
164 void incr_sum(IntVar& x, IntVarArgs& y, int mn) {
165 IntVarArgs s(*this, y.size()-1, 0, mn);
166 IntVarArgs t(y.size());
167 t[0] = y[0];
168 for (int i=1; i<y.size(); i++) {
169 rel(*this, s[i-1] >= y[i]-y[i-1]);
170 t[i] = s[i-1];
171 }
172 linear(*this, t, IRT_LQ, x);
173 }
174
175 /// Constructor for cloning \a s
176 Radiotherapy(Radiotherapy& s)

Callers

nothing calls this directly

Calls 3

relFunction · 0.50
linearFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected