src/forward_pdps.rs

branch
dev
changeset 63
7a8a55fd41c0
parent 61
4f468d35fa29
child 65
ec5f160c413b
--- a/src/forward_pdps.rs	Thu Feb 26 11:38:43 2026 -0500
+++ b/src/forward_pdps.rs	Thu Feb 26 11:36:22 2026 -0500
@@ -136,15 +136,15 @@
     Plot: Plotter<P::ReturnMapping, S, RNDM<N, F>>,
 {
     // Check parameters
-    // ensure!(
-    //     config.τ0 > 0.0
-    //         && config.τ0 < 1.0
-    //         && config.σp0 > 0.0
-    //         && config.σp0 < 1.0
-    //         && config.σd0 >= 0.0
-    //         && config.σp0 * config.σd0 <= 1.0,
-    //     "Invalid step length parameters"
-    // );
+    ensure!(
+        config.τ0 > 0.0
+            && config.τ0 < 1.0
+            && config.σp0 > 0.0
+            && config.σp0 < 1.0
+            && config.σd0 >= 0.0
+            && config.σp0 * config.σd0 <= 1.0,
+        "Invalid step length parameters"
+    );
 
     // Initialise iterates
     let mut μ = μ0.unwrap_or_else(|| DiscreteMeasure::new());
@@ -206,8 +206,6 @@
         let (maybe_d, _within_tolerances) = prox_penalty.insert_and_reweigh(
             &mut μ,
             &mut τv,
-            &μ_base,
-            None,
             τ,
             ε,
             &config.insertion,
@@ -216,6 +214,8 @@
             &mut stats,
         )?;
 
+        stats.inserted += μ.len() - μ_base.len();
+
         // Merge spikes.
         // This crucially expects the merge routine to be stable with respect to spike locations,
         // and not to performing any pruning. That is be to done below simultaneously for γ.
@@ -224,11 +224,8 @@
         // and not to performing any pruning. That is be to done below simultaneously for γ.
         let ins = &config.insertion;
         if ins.merge_now(&state) {
-            stats.merged += prox_penalty.merge_spikes_no_fitness(
-                &mut μ, &mut τv, &μ_base, None, τ, ε, ins,
-                &reg,
-                //Some(|μ̃ : &RNDM<N, F>| calculate_residual(Pair(μ̃, &z), opA, b).norm2_squared_div2()),
-            );
+            stats.merged +=
+                prox_penalty.merge_spikes_no_fitness(&mut μ, &mut τv, &μ_base, τ, ε, ins, &reg);
         }
 
         // Prune spikes with zero weight.

mercurial