| 235 | } |
| 236 | |
| 237 | void SwapStar::apply(Route *U, Route *V) const |
| 238 | { |
| 239 | stats_.numApplications++; |
| 240 | assert(best.U); |
| 241 | assert(best.UAfter); |
| 242 | assert(best.V); |
| 243 | assert(best.VAfter); |
| 244 | |
| 245 | U->remove(best.U->idx()); |
| 246 | V->remove(best.V->idx()); |
| 247 | |
| 248 | V->insert(best.UAfter->idx() + 1, best.U); |
| 249 | U->insert(best.VAfter->idx() + 1, best.V); |
| 250 | } |
| 251 | |
| 252 | void SwapStar::update(Route *U) { isCached(U->idx(), 0) = false; } |
| 253 |