src/prox_penalty/wave.rs

branch
dev
changeset 63
7a8a55fd41c0
parent 61
4f468d35fa29
--- a/src/prox_penalty/wave.rs	Thu Feb 26 11:38:43 2026 -0500
+++ b/src/prox_penalty/wave.rs	Thu Feb 26 11:36:22 2026 -0500
@@ -46,8 +46,6 @@
         &self,
         μ: &mut DiscreteMeasure<Domain, F>,
         τv: &mut M,
-        μ_base: &DiscreteMeasure<Domain, F>,
-        ν_delta: Option<&DiscreteMeasure<Domain, F>>,
         τ: F,
         ε: F,
         config: &InsertionConfig<F>,
@@ -67,10 +65,8 @@
                 _ => (config.max_insertions, !state.is_quiet()),
             };
 
-        let ω0 = match ν_delta {
-            None => self.apply(μ_base),
-            Some(ν) => self.apply(μ_base + ν),
-        };
+        let μ_base = μ.clone();
+        let ω0 = self.apply(&μ_base);
 
         // Add points to support until within error tolerance or maximum insertion count reached.
         let mut count = 0;
@@ -105,11 +101,7 @@
 
             // Form d = τv + 𝒟μ - ω0 = τv + 𝒟(μ - μ^k) for checking the proximate optimality
             // conditions in the predual space, and finding new points for insertion, if necessary.
-            let mut d = &*τv
-                + match ν_delta {
-                    None => self.preapply(μ.sub_matching(μ_base)),
-                    Some(ν) => self.preapply(μ.sub_matching(μ_base) - ν),
-                };
+            let mut d = &*τv + self.preapply(μ.sub_matching(&μ_base));
 
             // If no merging heuristic is used, let's be more conservative about spike insertion,
             // and skip it after first round. If merging is done, being more greedy about spike
@@ -135,7 +127,6 @@
             // No point in optimising the weight here; the finite-dimensional algorithm is fast.
             *μ += DeltaMeasure { x: ξ, α: 0.0 };
             count += 1;
-            stats.inserted += 1;
         };
 
         if !within_tolerances && warn_insertions {
@@ -156,7 +147,6 @@
         μ: &mut DiscreteMeasure<Domain, F>,
         τv: &mut M,
         μ_base: &DiscreteMeasure<Domain, F>,
-        ν_delta: Option<&DiscreteMeasure<Domain, F>>,
         τ: F,
         ε: F,
         config: &InsertionConfig<F>,
@@ -169,11 +159,7 @@
             }
         }
         μ.merge_spikes(config.merging, |μ_candidate| {
-            let mut d = &*τv
-                + self.preapply(match ν_delta {
-                    None => μ_candidate.sub_matching(μ_base),
-                    Some(ν) => μ_candidate.sub_matching(μ_base) - ν,
-                });
+            let mut d = &*τv + self.preapply(μ_candidate.sub_matching(μ_base));
             reg.verify_merge_candidate(&mut d, μ_candidate, τ, ε, config)
         })
     }

mercurial