src/prox_penalty.rs

changeset 75
677a5fd1b014
parent 63
7a8a55fd41c0
child 76
b921ed0ab99b
child 78
2a122736e91c
--- 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, F>,
     Domain: Space + Clone,
 {
+    /// Unused, but required as a plotter parametrisation.
     type ReturnMapping: Mapping<Domain, Codomain = F>;
 
     /// 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<I>,
         stats: &mut IterInfo<F>,
-    ) -> DynResult<(Option<Self::ReturnMapping>, bool)>
+    ) -> DynResult<bool>
+    where
+        I: AlgIterator;
+
+    /// A variant of [`insert_and_reweigh`] that only does finite-dimensional weight optimisation,
+    /// without inserting spikes.
+    fn reweigh<I>(
+        &self,
+        μ: &mut DiscreteMeasure<Domain, F>,
+        τv: &mut PreadjointCodomain,
+        τ: F,
+        ε: F,
+        config: &InsertionConfig<F>,
+        reg: &Reg,
+        state: &AlgIteratorIteration<I>,
+        stats: &mut IterInfo<F>,
+    ) -> DynResult<()>
     where
         I: AlgIterator;
 

mercurial