| 238 // This crucially expects the merge routine to be stable with respect to spike locations, |
238 // This crucially expects the merge routine to be stable with respect to spike locations, |
| 239 // and not to performing any pruning. That is be to done below simultaneously for γ. |
239 // and not to performing any pruning. That is be to done below simultaneously for γ. |
| 240 // Merge spikes. |
240 // Merge spikes. |
| 241 // This crucially expects the merge routine to be stable with respect to spike locations, |
241 // This crucially expects the merge routine to be stable with respect to spike locations, |
| 242 // and not to performing any pruning. That is be to done below simultaneously for γ. |
242 // and not to performing any pruning. That is be to done below simultaneously for γ. |
| 243 let ins = &config.insertion; |
243 config.insertion.if_merge_now(&state, |ins| { |
| 244 if ins.merge_now(&state) { |
|
| 245 stats.merged += prox_penalty.merge_spikes( |
244 stats.merged += prox_penalty.merge_spikes( |
| 246 &mut μ, |
245 &mut μ, |
| 247 &mut τv, |
246 &mut τv, |
| 248 &μ_base, |
247 &μ_base, |
| 249 τ, |
248 τ, |
| 250 ε, |
249 ε, |
| 251 ins, |
250 ins, |
| 252 ®, |
251 ®, |
| 253 Some(|μ̃: &RNDM<N, F>| f.apply(Pair(μ̃, &z))), |
252 Some(|μ̃: &RNDM<N, F>| f.apply(Pair(μ̃, &z))), |
| 254 ); |
253 ); |
| 255 } |
254 }); |
| 256 |
255 |
| 257 // Prune spikes with zero weight. |
256 // Prune spikes with zero weight. |
| 258 stats.pruned += prune_with_stats(&mut μ); |
257 stats.pruned += prune_with_stats(&mut μ); |
| 259 |
258 |
| 260 for _ in 0..config.insertion.extra_weight_optimisation_steps { |
259 for _ in 0..config.insertion.extra_weight_optimisation_steps { |