| 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 |