forceinline ExecStatus MultZeroOne<View>::post(Home home, View x0, View x1) { switch (rtest_eq(x0,0.0)) { case RT_FALSE: GECODE_ME_CHECK(x1.eq(home,1.0)); break; case RT_TRUE: break; case RT_MAYBE: switch (rtest_eq(x1,1.0)) { case RT_FALSE: GECODE_ME_CHECK(x0.eq(home,0.0)); break; case RT_TRUE: break; case RT_MAYBE: (void) new (home) MultZeroOne<View>(home,x0,x1); break; default: GECODE_NEVER; } break; default: GECODE_NEVER; } return ES_OK; }
ExecStatus ReEq<View,CtrlView,rm>::propagate(Space& home, const ModEventDelta&) { if (b.one()) { if (rm == RM_PMI) return home.ES_SUBSUMED(*this); GECODE_REWRITE(*this,(Eq<View,View>::post(home(*this),x0,x1))); } if (b.zero()) { if (rm == RM_IMP) return home.ES_SUBSUMED(*this); GECODE_REWRITE(*this,(Nq<View,View>::post(home(*this),x0,x1))); } switch (rtest_eq(x0,x1)) { case RT_TRUE: if (rm != RM_IMP) GECODE_ME_CHECK(b.one_none(home)); break; case RT_FALSE: if (rm != RM_PMI) GECODE_ME_CHECK(b.zero_none(home)); break; case RT_MAYBE: return ES_FIX; default: GECODE_NEVER; } return home.ES_SUBSUMED(*this); }
ExecStatus MultZeroOne<View>::propagate(Space& home, const ModEventDelta&) { switch (rtest_eq(x0,0.0)) { case RT_FALSE: GECODE_ME_CHECK(x1.eq(home,1.0)); break; case RT_TRUE: break; case RT_MAYBE: switch (rtest_eq(x1,1.0)) { case RT_FALSE: GECODE_ME_CHECK(x0.eq(home,0.0)); break; case RT_TRUE: break; case RT_MAYBE: return ES_FIX; default: GECODE_NEVER; } break; default: GECODE_NEVER; } return home.ES_SUBSUMED(*this); }
ExecStatus ReEqFloat<View,CtrlView,rm>::propagate(Space& home, const ModEventDelta&) { if (b.one()) { if (rm != RM_PMI) GECODE_ME_CHECK(x0.eq(home,c)); } else { switch (rtest_eq(x0,c)) { case RT_TRUE: if (rm != RM_IMP) GECODE_ME_CHECK(b.one(home)); break; case RT_FALSE: if (rm != RM_PMI) GECODE_ME_CHECK(b.zero(home)); break; case RT_MAYBE: return ES_FIX; default: GECODE_NEVER; } } return home.ES_SUBSUMED(*this); }