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

Method reset

gecode/int/linear/int-dom.hpp:239–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 */
238 template<class Val>
239 forceinline bool
240 PosSupportIter<Val>::reset(Val& d) {
241 // Way too small, no value can make it big enough
242 if (d + static_cast<Val>(a)*x.max() < u)
243 return false;
244 // Restart iterator and position of values
245 i.init(x.varimp()); p = 0;
246 // Skip all ranges which are too small
247 while (d + static_cast<Val>(a)*i.max() < u) {
248 p += i.width(); ++i;
249 }
250 // There is at least one range left (check of max)
251 assert(i());
252 // Initialize current range and adjust value
253 c = i.min();
254 // Skip all values which are too small
255 while (d + static_cast<Val>(a)*c < u) {
256 p++; c++;
257 }
258 // Adjust to new value
259 d += static_cast<Val>(a) * c;
260 return true;
261 }
262 template<class Val>
263 forceinline bool
264 PosSupportIter<Val>::adjust(Val& d) {

Callers 1

propagateMethod · 0.45

Calls 7

iFunction · 0.50
maxMethod · 0.45
initMethod · 0.45
varimpMethod · 0.45
widthMethod · 0.45
minMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected