| 147 | } |
| 148 | template<class View> |
| 149 | Propagator* |
| 150 | Single<View>::copy(Space& home) { |
| 151 | // Try to eliminate assigned views at the beginning |
| 152 | if (alpha > 0) { |
| 153 | int i = 0; |
| 154 | while ((i < alpha) && x[i].assigned()) |
| 155 | i++; |
| 156 | x.drop_fst(i); |
| 157 | for (Advisors<Index> as(c); as(); ++as) |
| 158 | as.advisor().i -= i; |
| 159 | alpha -= i; beta -= i; gamma -= i; |
| 160 | } |
| 161 | // Try to eliminate assigned views at the end |
| 162 | if (gamma < x.size()) { |
| 163 | int i = x.size()-1; |
| 164 | while ((i > gamma) && x[i].assigned()) |
| 165 | i--; |
| 166 | x.drop_lst(i); |
| 167 | } |
| 168 | return new (home) Single<View>(home, *this); |
| 169 | } |
| 170 | |
| 171 | |
| 172 | template<class View> |