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

Method propagate

gecode/int/bool/ite.hpp:118–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116
117 template<class V0, class V1, class V2>
118 ExecStatus
119 IteBnd<V0,V1,V2>::propagate(Space& home, const ModEventDelta&) {
120 if (b.one())
121 GECODE_REWRITE(*this,(Rel::EqBnd<V2,V0>::post(home(*this),x2,x0)));
122 if (b.zero())
123 GECODE_REWRITE(*this,(Rel::EqBnd<V2,V1>::post(home(*this),x2,x1)));
124
125 GECODE_ME_CHECK(x2.lq(home,std::max(x0.max(),x1.max())));
126 GECODE_ME_CHECK(x2.gq(home,std::min(x0.min(),x1.min())));
127
128 RelTest eq20 = rtest_eq_bnd(x2,x0);
129 RelTest eq21 = rtest_eq_bnd(x2,x1);
130
131 if ((eq20 == RT_FALSE) && (eq21 == RT_FALSE))
132 return ES_FAILED;
133
134 if (eq20 == RT_FALSE) {
135 GECODE_ME_CHECK(b.zero_none(home));
136 if (eq21 == RT_TRUE)
137 return home.ES_SUBSUMED(*this);
138 else
139 GECODE_REWRITE(*this,(Rel::EqBnd<V2,V1>::post(home(*this),x2,x1)));
140 }
141
142 if (eq21 == RT_FALSE) {
143 GECODE_ME_CHECK(b.one_none(home));
144 if (eq20 == RT_TRUE)
145 return home.ES_SUBSUMED(*this);
146 else
147 GECODE_REWRITE(*this,(Rel::EqBnd<V2,V0>::post(home(*this),x2,x0)));
148 }
149
150 if ((eq20 == RT_TRUE) && (eq21 == RT_TRUE))
151 return home.ES_SUBSUMED(*this);
152
153 return ES_FIX;
154 }
155
156
157

Callers

nothing calls this directly

Calls 15

rtest_eq_bndFunction · 0.85
rtest_eq_domFunction · 0.85
ES_SUBSUMEDMethod · 0.80
ES_FIX_PARTIALMethod · 0.80
postFunction · 0.50
maxFunction · 0.50
minFunction · 0.50
oneMethod · 0.45
zeroMethod · 0.45
lqMethod · 0.45
maxMethod · 0.45
gqMethod · 0.45

Tested by

no test coverage detected