| 145 reg: &Reg, |
145 reg: &Reg, |
| 146 prox_penalty: &P, |
146 prox_penalty: &P, |
| 147 pdpsconfig: &PDPSConfig<F>, |
147 pdpsconfig: &PDPSConfig<F>, |
| 148 iterator: I, |
148 iterator: I, |
| 149 mut plotter: Plot, |
149 mut plotter: Plot, |
| 150 μ0 : Option<RNDM<N, F>>, |
150 μ0: Option<RNDM<N, F>>, |
| 151 ) -> DynResult<RNDM<N, F>> |
151 ) -> DynResult<RNDM<N, F>> |
| 152 where |
152 where |
| 153 F: Float + ToNalgebraRealField, |
153 F: Float + ToNalgebraRealField, |
| 154 I: AlgIteratorFactory<IterInfo<F>>, |
154 I: AlgIteratorFactory<IterInfo<F>>, |
| 155 A: ForwardModel<RNDM<N, F>, F>, |
155 A: ForwardModel<RNDM<N, F>, F>, |
| 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.insert_and_reweigh( |
209 let (maybe_d, _within_tolerances) = prox_penalty |
| 210 &mut μ, &mut τv, &μ_base, None, τ, ε, config, ®, &state, &mut stats, |
210 .insert_and_reweigh(&mut μ, &mut τv, τ, ε, config, ®, &state, &mut stats)?; |
| 211 )?; |
|
| 212 |
211 |
| 213 // Prune and possibly merge spikes |
212 // Prune and possibly merge spikes |
| 214 if config.merge_now(&state) { |
213 if config.merge_now(&state) { |
| 215 stats.merged += prox_penalty |
214 stats.merged += |
| 216 .merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, None, τ, ε, config, ®); |
215 prox_penalty.merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, τ, ε, config, ®); |
| 217 } |
216 } |
| |
217 stats.inserted += μ.len() - μ_base.len(); |
| 218 stats.pruned += prune_with_stats(&mut μ); |
218 stats.pruned += prune_with_stats(&mut μ); |
| 219 |
219 |
| 220 // Update step length parameters |
220 // Update step length parameters |
| 221 let ω = pdpsconfig.acceleration.accelerate(&mut τ, &mut σ, γ); |
221 let ω = pdpsconfig.acceleration.accelerate(&mut τ, &mut σ, γ); |
| 222 |
222 |