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

Method propagate

gecode/float/bool/ite.hpp:106–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105 template<class View>
106 ExecStatus
107 Ite<View>::propagate(Space& home, const ModEventDelta&) {
108 if (b.one())
109 GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x0)));
110 if (b.zero())
111 GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x1)));
112
113 GECODE_ME_CHECK(x2.lq(home,std::max(x0.max(),x1.max())));
114 GECODE_ME_CHECK(x2.gq(home,std::min(x0.min(),x1.min())));
115
116 RelTest eq20 = rtest_eq(x2,x0);
117 RelTest eq21 = rtest_eq(x2,x1);
118
119 if ((eq20 == RT_FALSE) && (eq21 == RT_FALSE))
120 return ES_FAILED;
121
122 if (eq20 == RT_FALSE) {
123 GECODE_ME_CHECK(b.zero_none(home));
124 if (eq21 == RT_TRUE)
125 return home.ES_SUBSUMED(*this);
126 else
127 GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x1)));
128 }
129
130 if (eq21 == RT_FALSE) {
131 GECODE_ME_CHECK(b.one_none(home));
132 if (eq20 == RT_TRUE)
133 return home.ES_SUBSUMED(*this);
134 else
135 GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x0)));
136 }
137
138 if ((eq20 == RT_TRUE) && (eq21 == RT_TRUE))
139 return home.ES_SUBSUMED(*this);
140
141 return ES_FIX;
142 }
143
144}}}
145

Callers

nothing calls this directly

Calls 13

rtest_eqFunction · 0.85
ES_SUBSUMEDMethod · 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
minMethod · 0.45
zero_noneMethod · 0.45

Tested by

no test coverage detected