| 204 |
204 |
| 205 // Save current base point |
205 // Save current base point |
| 206 let μ_base = μ.clone(); |
206 let μ_base = μ.clone(); |
| 207 |
207 |
| 208 // Insert and reweigh |
208 // Insert and reweigh |
| 209 let (maybe_d, _within_tolerances) = prox_penalty |
209 prox_penalty.insert_and_reweigh(&mut μ, &mut τv, τ, ε, config, ®, &state, &mut stats)?; |
| 210 .insert_and_reweigh(&mut μ, &mut τv, τ, ε, config, ®, &state, &mut stats)?; |
|
| 211 |
210 |
| 212 // Prune and possibly merge spikes |
211 // Prune and possibly merge spikes |
| 213 if config.merge_now(&state) { |
212 if config.merge_now(&state) { |
| 214 stats.merged += |
213 stats.merged += |
| 215 prox_penalty.merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, τ, ε, config, ®); |
214 prox_penalty.merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, τ, ε, config, ®); |
| 232 // Give statistics if requested |
231 // Give statistics if requested |
| 233 let iter = state.iteration(); |
232 let iter = state.iteration(); |
| 234 stats.this_iters += 1; |
233 stats.this_iters += 1; |
| 235 |
234 |
| 236 state.if_verbose(|| { |
235 state.if_verbose(|| { |
| 237 plotter.plot_spikes(iter, maybe_d.as_ref(), Some(&τv), &μ); |
236 plotter.plot_spikes(iter, None, Some(&τv), &μ); |
| 238 full_stats(&μ, ε, std::mem::replace(&mut stats, IterInfo::new())) |
237 full_stats(&μ, ε, std::mem::replace(&mut stats, IterInfo::new())) |
| 239 }); |
238 }); |
| 240 |
239 |
| 241 ε = tolerance.update(ε, iter); |
240 ε = tolerance.update(ε, iter); |
| 242 } |
241 } |