src/forward_pdps.rs

changeset 91
47d495348e38
parent 89
8d1c959432c8
child 93
8f1e57821d76
--- a/src/forward_pdps.rs	Tue Aug 04 19:24:55 2026 -0500
+++ b/src/forward_pdps.rs	Tue Aug 04 19:41:34 2026 -0500
@@ -220,6 +220,7 @@
         let Pair(v, z_tmp) = f.differential(Pair(&μ, &z));
         let mut τv = v * τ;
         let μ_base = μ.clone();
+        let μ_base_len = μ_base.len();
 
         // Construct μ^{k+1} by solving finite-dimensional subproblems and insert new spikes.
         prox_penalty.insert_and_reweigh(
@@ -251,7 +252,8 @@
                 &reg,
                 Some(|μ̃: &RNDM<N, F>| f.apply(Pair(μ̃, &z)) + reg.apply(μ̃)),
             );
-            stats.pruned += prune_with_stats(&mut μ);
+            // Prune. Do not prune new insertions on first round.
+            stats.pruned += prune_with_stats(&mut μ, μ_base_len);
 
             if config.insertion.random_insertions {
                 if let Some(x) = domain.random_point() {
@@ -288,7 +290,8 @@
         })?;
 
         if did_merge.is_none() {
-            stats.pruned += prune_with_stats(&mut μ);
+            // Prune. Do not prune new insertions on first round.
+            stats.pruned += prune_with_stats(&mut μ, μ_base_len);
         }
 
         // Update step length parameters

mercurial