diff -r 51dbb2cc25d9 -r 8d1c959432c8 src/run.rs --- a/src/run.rs Tue Aug 04 13:46:29 2026 -0500 +++ b/src/run.rs Tue Aug 04 14:12:18 2026 -0500 @@ -2,7 +2,8 @@ This module provides [`RunnableExperiment`] for running chosen algorithms on a chosen experiment. */ -use crate::fb::{pointsource_fb_reg, pointsource_fista_reg, FBConfig, InsertionConfig}; +use crate::domain::{AdmissibleDomain, FullSpace}; +use crate::fb::{pointsource_fb_dom, pointsource_fista_reg, FBConfig, InsertionConfig}; use crate::forward_model::sensor_grid::{ //SensorGridBTFN, Sensor, @@ -11,7 +12,9 @@ Spread, }; use crate::forward_model::*; -use crate::forward_pdps::{pointsource_fb_pair, pointsource_forward_pdps_pair, ForwardPDPSConfig}; +use crate::forward_pdps::{ + pointsource_fb_pair_dom, pointsource_forward_pdps_pair_dom, ForwardPDPSConfig, +}; use crate::frank_wolfe::{pointsource_fw_reg, FWConfig, FWVariant, RegTermFW}; use crate::kernels::*; use crate::measures::merging::{SpikeMerging, SpikeMergingMethod}; @@ -24,7 +27,7 @@ use crate::regularisation::{NonnegRadonRegTerm, RadonRegTerm, Regularisation, SlidingRegTerm}; use crate::seminorms::*; use crate::sliding_fb::{ - pointsource_sliding_fb_dom, SlidingFBConfig, TransportConfig, TransportProxPenalty, + pointsource_sliding_fb, SlidingFBConfig, TransportConfig, TransportProxPenalty, }; use crate::sliding_pdps::{ pointsource_sliding_fb_pair_dom, pointsource_sliding_pdps_pair_dom, SlidingPDPSConfig, @@ -127,6 +130,7 @@ extra_weight_optimisation_steps: cli .extra_weight_optimisation_steps .unwrap_or(g.extra_weight_optimisation_steps), + random_insertions: cli.random_insertions.unwrap_or(g.random_insertions), tolerance: cli .tolerance .as_ref() @@ -989,13 +993,7 @@ f: &Dat, reg: &Reg, prox_penalty: &P, - init: ( - &AlgorithmConfig, - I, - Plot, - Option>, - String, - ), + init: (&AlgorithmConfig, I, Plot, Option>, String), cont: impl FnOnce( (&AlgorithmConfig, I, Plot, Option>, String), ) -> DynResult>, @@ -1011,7 +1009,7 @@ P: TransportProxPenalty, Dat::DerivativeDomain, Reg, F> + StepLengthBound, Plot: Plotter>, { - run_fb_dom(f, reg, prox_penalty, init, None, cont) + run_fb_dom(f, reg, prox_penalty, init, &mut FullSpace, cont) } /// Runs FB-style algorithms if `alg` so requests and `prox_penalty` matches. @@ -1028,7 +1026,7 @@ Option>, String, ), - domain: Option<&P::Dom>, + domain: &mut impl AdmissibleDomain>, cont: impl FnOnce( (&AlgorithmConfig, I, Plot, Option>, String), ) -> DynResult>, @@ -1049,7 +1047,16 @@ match alg { &AlgorithmConfig::FB(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); - pointsource_fb_reg(f, reg, prox_penalty, algconfig, iterator, plotter, μ0) + pointsource_fb_dom( + f, + reg, + prox_penalty, + algconfig, + iterator, + plotter, + μ0, + domain, + ) } &AlgorithmConfig::FISTA(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); @@ -1057,7 +1064,16 @@ } &AlgorithmConfig::SlidingFB(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); - pointsource_sliding_fb_dom(f, reg, prox_penalty, algconfig, iterator, plotter, μ0, domain) + pointsource_sliding_fb( + f, + reg, + prox_penalty, + algconfig, + iterator, + plotter, + μ0, + domain, + ) } _ => cont((alg, iterator, plotter, μ0, running)), } @@ -1294,11 +1310,29 @@ save_extra, (μ0, z, y), |p| { - run_pdps_pair_dom(&f, ®, &RadonSquared, &opKz, &fnR, &fnH, p, None, |q| { - run_pdps_pair_dom(&f, ®, &op𝒟, &opKz, &fnR, &fnH, q, None, |_| { - Err(NotImplemented.into()) - }) - }) + run_pdps_pair_dom( + &f, + ®, + &RadonSquared, + &opKz, + &fnR, + &fnH, + p, + &mut FullSpace, + |q| { + run_pdps_pair_dom( + &f, + ®, + &op𝒟, + &opKz, + &fnR, + &fnH, + q, + &mut FullSpace, + |_| Err(NotImplemented.into()), + ) + }, + ) .map(|Pair(μ, z)| (μ, z)) }, ) @@ -1314,11 +1348,29 @@ save_extra, (μ0, z, y), |p| { - run_pdps_pair_dom(&f, ®, &RadonSquared, &opKz, &fnR, &fnH, p, None, |q| { - run_pdps_pair_dom(&f, ®, &op𝒟, &opKz, &fnR, &fnH, q, None, |_| { - Err(NotImplemented.into()) - }) - }) + run_pdps_pair_dom( + &f, + ®, + &RadonSquared, + &opKz, + &fnR, + &fnH, + p, + &mut FullSpace, + |q| { + run_pdps_pair_dom( + &f, + ®, + &op𝒟, + &opKz, + &fnR, + &fnH, + q, + &mut FullSpace, + |_| Err(NotImplemented.into()), + ) + }, + ) .map(|Pair(μ, z)| (μ, z)) }, ) @@ -1379,7 +1431,17 @@ for<'b> H::Conjugate<'b>: Prox, Plot: Plotter>, { - run_pdps_pair_dom(f, reg, prox_penalty, opKz, fnR, fnH, init, None, cont) + run_pdps_pair_dom( + f, + reg, + prox_penalty, + opKz, + fnR, + fnH, + init, + &mut FullSpace, + cont, + ) } pub fn run_pdps_pair_dom( @@ -1396,7 +1458,7 @@ (Option>, Z, Y), String, ), - domain: Option<&P::Dom>, + domain: &mut impl AdmissibleDomain>, cont: impl FnOnce( ( &AlgorithmConfig, @@ -1436,7 +1498,7 @@ match alg { &AlgorithmConfig::ForwardPDPS(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); - pointsource_forward_pdps_pair( + pointsource_forward_pdps_pair_dom( f, reg, prox_penalty, @@ -1447,6 +1509,7 @@ opKz, fnR, fnH, + domain, ) } &AlgorithmConfig::SlidingPDPS(ref algconfig, prox_type) if prox_type == pt => { @@ -1508,7 +1571,7 @@ // We should not need to explicitly require this: for<'b> &'b Loc<0, F>: Instance>, { - run_fb_pair_dom(f, reg, prox_penalty, fnR, init, None, cont) + run_fb_pair_dom(f, reg, prox_penalty, fnR, init, &mut FullSpace, cont) } pub fn run_fb_pair_dom( @@ -1523,7 +1586,7 @@ (Option>, Z), String, ), - domain: Option<&P::Dom>, + domain: &mut impl AdmissibleDomain>, cont: impl FnOnce( ( &AlgorithmConfig, @@ -1556,7 +1619,17 @@ match alg { &AlgorithmConfig::FB(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); - pointsource_fb_pair(f, reg, prox_penalty, algconfig, iterator, plotter, μ0z, fnR) + pointsource_fb_pair_dom( + f, + reg, + prox_penalty, + algconfig, + iterator, + plotter, + μ0z, + fnR, + domain, + ) } &AlgorithmConfig::SlidingFB(ref algconfig, prox_type) if prox_type == pt => { print!("{running}"); @@ -1569,7 +1642,7 @@ plotter, μ0z, fnR, - domain + domain, ) } _ => cont((alg, iterator, plotter, μ0z, running)),