| 133 | } |
| 134 | template<class View> |
| 135 | Propagator* |
| 136 | Single<View>::copy(Space& home) { |
| 137 | // Try to eliminate assigned views at the beginning |
| 138 | if (alpha > 0) { |
| 139 | int i = 0; |
| 140 | while ((i < alpha) && x[i].assigned()) |
| 141 | i++; |
| 142 | x.drop_fst(i); |
| 143 | for (Advisors<Index> as(c); as(); ++as) |
| 144 | as.advisor().i -= i; |
| 145 | alpha -= i; beta -= i; gamma -= i; |
| 146 | } |
| 147 | // Try to eliminate assigned views at the end |
| 148 | if (gamma < x.size()) { |
| 149 | int i = x.size()-1; |
| 150 | while ((i > gamma) && x[i].assigned()) |
| 151 | i--; |
| 152 | x.drop_lst(i); |
| 153 | } |
| 154 | return new (home) Single<View>(home, *this); |
| 155 | } |
| 156 | |
| 157 | |
| 158 | template<class View> |