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

Method narrow_r

gecode/int/var-imp/bool.hpp:275–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273 */
274 template<class I>
275 forceinline ModEvent
276 BoolVarImp::narrow_r(Space& home, I& i, bool) {
277 // Is new domain empty?
278 if (!i())
279 return fail(home);
280 assert((i.min() == 0) || (i.min() == 1));
281 assert((i.max() == 0) || (i.max() == 1));
282 if (i.max() == 0) {
283 assert(!one());
284 // Assign domain to be zero (domain cannot be one)
285 return zero(home);
286 }
287 if (i.min() == 1) {
288 // Assign domain to be one (domain cannot be zero)
289 assert(!zero());
290 return one(home);
291 }
292 assert(none());
293 return ME_INT_NONE;
294 }
295 template<class I>
296 forceinline ModEvent
297 BoolVarImp::inter_r(Space& home, I& i, bool) {

Callers

nothing calls this directly

Calls 4

iFunction · 0.50
oneFunction · 0.50
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected