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

Method advise

gecode/int/precede/single.hpp:182–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180
181 template<class View>
182 ExecStatus
183 Single<View>::advise(Space& home, Advisor& a0, const Delta& d) {
184 Index& a(static_cast<Index&>(a0));
185 int i = a.i;
186 // Check for gamma
187 if ((beta <= gamma) && (i < gamma) && assigned(x[i],t))
188 gamma = i;
189 if (x[i].assigned()) {
190 a.dispose(home,c);
191 if (c.empty())
192 return ES_NOFIX;
193 } else if ((i < alpha) || (i > gamma)) {
194 x[i].cancel(home,a);
195 a.dispose(home,c);
196 return (c.empty()) ? ES_NOFIX : ES_FIX;
197 }
198 if (beta > gamma)
199 return ES_NOFIX;
200 if ((alpha == i) || (beta == i)) {
201 if (x[i].any(d) && !x[i].in(s))
202 return ES_NOFIX;
203 if ((x[i].min(d) <= s) && (s <= x[i].max(d)))
204 return ES_NOFIX;
205 }
206 return ES_FIX;
207 }
208
209 template<class View>
210 ExecStatus

Callers

nothing calls this directly

Calls 9

assignedFunction · 0.85
assignedMethod · 0.45
disposeMethod · 0.45
emptyMethod · 0.45
cancelMethod · 0.45
anyMethod · 0.45
inMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected