diff -r df92e78cc3f4 -r 677a5fd1b014 src/prox_penalty.rs --- a/src/prox_penalty.rs Thu Jul 16 19:51:51 2026 +0300 +++ b/src/prox_penalty.rs Sun Jul 19 07:30:06 2026 +0200 @@ -65,8 +65,9 @@ /// Iterations between merging heuristic tries pub merge_every: usize, - // /// Save $μ$ for postprocessing optimisation - // pub postprocessing : bool + + /// Additional weight optimisation steps + pub extra_weight_optimisation_steps: usize, } #[replace_float_literals(F::cast_from(literal))] @@ -85,7 +86,7 @@ fitness_merging: false, merge_every: 10, merge_tolerance_mult: 2.0, - // postprocessing : false, + extra_weight_optimisation_steps: 0, } } } @@ -118,6 +119,7 @@ Reg: RegTerm, Domain: Space + Clone, { + /// Unused, but required as a plotter parametrisation. type ReturnMapping: Mapping; /// Returns the type of this proximality penalty @@ -126,8 +128,7 @@ /// Insert new spikes into `μ` to approximately satisfy optimality conditions /// with the forward step term fixed to `τv`. /// - /// May return `τv + w` for `w` a subdifferential of the regularisation term `reg`, - /// as well as an indication of whether the tolerance bounds `ε` are satisfied. + /// Returns an indication of whether the tolerance bounds `ε` are satisfied. /// /// `τv` is mutable to allow [`alg_tools::bounds::MinMaxMapping`] optimisation to /// refine data. Actual values of `τv` are not supposed to be mutated. @@ -144,7 +145,23 @@ reg: &Reg, state: &AlgIteratorIteration, stats: &mut IterInfo, - ) -> DynResult<(Option, bool)> + ) -> DynResult + where + I: AlgIterator; + + /// A variant of [`insert_and_reweigh`] that only does finite-dimensional weight optimisation, + /// without inserting spikes. + fn reweigh( + &self, + μ: &mut DiscreteMeasure, + τv: &mut PreadjointCodomain, + τ: F, + ε: F, + config: &InsertionConfig, + reg: &Reg, + state: &AlgIteratorIteration, + stats: &mut IterInfo, + ) -> DynResult<()> where I: AlgIterator;