Exemplo n.º 1
0
 forceinline ModEvent
 FloatVarImp::lq(Space& home, const FloatVal& n) {
   if (n.max() >= dom.max()) return ME_FLOAT_NONE;
   if (n.max() < dom.min())  return ME_FLOAT_FAILED;
   FloatDelta d(n.min(),dom.max());
   ModEvent me = ME_FLOAT_BND;
   dom = intersect(dom,FloatVal(dom.min(),n.min()));
   if (assigned()) me = ME_FLOAT_VAL;
   GECODE_ASSUME((me == ME_FLOAT_VAL) |
                 (me == ME_FLOAT_BND));
   return notify(home,me,d);
 }
Exemplo n.º 2
0
 forceinline ModEvent
 FloatVarImp::gq(Space& home, FloatNum n) {
   if (n > dom.max())  return ME_FLOAT_FAILED;
   if ((n <= dom.min()) || assigned()) return ME_FLOAT_NONE;
   FloatDelta d(dom.min(),n);
   ModEvent me = ME_FLOAT_BND;
   dom = intersect(dom,FloatVal(n,dom.max()));
   if (assigned()) me = ME_FLOAT_VAL;
   GECODE_ASSUME((me == ME_FLOAT_VAL) |
                 (me == ME_FLOAT_BND));
   return notify(home,me,d);
 }
Exemplo n.º 3
0
 forceinline ModEvent
 FloatVarImp::eq(Space& home, const FloatVal& n) {
   if (!overlap(dom,n))
     return ME_FLOAT_FAILED;
   if (assigned() || subset(dom,n))
     return ME_FLOAT_NONE;
   FloatDelta d;
   ModEvent me = ME_FLOAT_BND;
   dom = intersect(dom,n);
   if (assigned()) me = ME_FLOAT_VAL;
   GECODE_ASSUME((me == ME_FLOAT_VAL) |
                 (me == ME_FLOAT_BND));
   return notify(home,me,d);
 }