diff -r 759634edb536 -r 8f1e57821d76 src/run.rs --- a/src/run.rs Tue Aug 04 20:11:10 2026 -0500 +++ b/src/run.rs Thu Aug 06 11:14:15 2026 -0500 @@ -55,7 +55,7 @@ }; use alg_tools::maputil::map3; use alg_tools::nalgebra_support::ToNalgebraRealField; -use alg_tools::norms::{NormExponent, L1, L2}; +use alg_tools::norms::{Dist, NormExponent, L1, L2}; use alg_tools::operator_arithmetic::Weighted; use alg_tools::sets::Cube; use alg_tools::sets::SetOrd; @@ -1086,30 +1086,36 @@ /// $L^2$-squared data term is enabled through the type signatures. /// /// `cont` gives a continuation attempt to find the algorithm matching the description `alg`. -pub fn run_fw<'a, F, A, Reg, I, Plot, const N: usize>( - f: &'a DataTerm, A, Norm222>, +pub fn run_fw<'a, F, U, A, Reg, I, Plot>( + f: &'a DataTerm, A, Norm222>, reg: &Reg, (alg, iterator, plotter, μ0, running): ( &AlgorithmConfig, I, Plot, - Option>, + Option>, String, ), cont: impl FnOnce( - (&AlgorithmConfig, I, Plot, Option>, String), - ) -> DynResult>, -) -> DynResult> + ( + &AlgorithmConfig, + I, + Plot, + Option>, + String, + ), + ) -> DynResult>, +) -> DynResult> where F: Float + ToNalgebraRealField, + U: Space + Clone + PartialEq, I: AlgIteratorFactory>, - A: ForwardModel, F>, - A::PreadjointCodomain: MinMaxMapping, F>, + A: ForwardModel, F>, + A::PreadjointCodomain: MinMaxMapping, for<'b> &'b A::PreadjointCodomain: Instance, - Cube: P2Minimise, F>, - RNDM: SpikeMerging, - Reg: RegTermFW, N>, - Plot: Plotter>, + DiscreteMeasure: SpikeMerging, + Reg: RegTermFW>, + Plot: Plotter>, { match alg { &AlgorithmConfig::FW(ref algconfig) => { @@ -1381,10 +1387,10 @@ } } -type MeasureZ = Pair, Z>; +type MeasureZ = Pair, Z>; #[deprecated] -pub fn run_pdps_pair( +pub fn run_pdps_pair( f: &Dat, reg: &Reg, prox_penalty: &P, @@ -1395,7 +1401,7 @@ &AlgorithmConfig, I, Plot, - (Option>, Z, Y), + (Option>, Z, Y), String, ), cont: impl FnOnce( @@ -1403,22 +1409,24 @@ &AlgorithmConfig, I, Plot, - (Option>, Z, Y), + (Option>, Z, Y), String, ), - ) -> DynResult, Z>>, -) -> DynResult, Z>> + ) -> DynResult, Z>>, +) -> DynResult, Z>> where F: Float + ToNalgebraRealField, + U: Space + Clone + Dist, + for<'a> &'a U: Instance, I: AlgIteratorFactory>, - Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + BoundedCurvature, - S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, + S: DifferentiableMapping + ClosedMul + MinMaxMapping, for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, //Pair: ClosedMul, - RNDM: SpikeMerging, - Reg: SlidingRegTerm, F>, - P: TransportProxPenalty, S, Reg, F>, + DiscreteMeasure: SpikeMerging, + Reg: SlidingRegTerm, + P: TransportProxPenalty, KOpZ: BoundedLinear + GEMV + SimplyAdjointable, @@ -1430,7 +1438,7 @@ R: Prox, H: Conjugable, for<'b> H::Conjugate<'b>: Prox, - Plot: Plotter>, + Plot: Plotter>, { run_pdps_pair_dom( f, @@ -1445,7 +1453,7 @@ ) } -pub fn run_pdps_pair_dom( +pub fn run_pdps_pair_dom( f: &Dat, reg: &Reg, prox_penalty: &P, @@ -1456,31 +1464,33 @@ &AlgorithmConfig, I, Plot, - (Option>, Z, Y), + (Option>, Z, Y), String, ), - domain: &mut impl AdmissibleDomain>, + domain: &mut impl AdmissibleDomain, cont: impl FnOnce( ( &AlgorithmConfig, I, Plot, - (Option>, Z, Y), + (Option>, Z, Y), String, ), - ) -> DynResult, Z>>, -) -> DynResult, Z>> + ) -> DynResult, Z>>, +) -> DynResult, Z>> where F: Float + ToNalgebraRealField, + U: Space + Clone + Dist, + for<'a> &'a U: Instance, I: AlgIteratorFactory>, - Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + BoundedCurvature, - S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, + S: DifferentiableMapping + ClosedMul + MinMaxMapping, for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, //Pair: ClosedMul, - RNDM: SpikeMerging, - Reg: SlidingRegTerm, F>, - P: TransportProxPenalty, S, Reg, F>, + DiscreteMeasure: SpikeMerging, + Reg: SlidingRegTerm, + P: TransportProxPenalty, KOpZ: BoundedLinear + GEMV + SimplyAdjointable, @@ -1492,7 +1502,7 @@ R: Prox, H: Conjugable, for<'b> H::Conjugate<'b>: Prox, - Plot: Plotter>, + Plot: Plotter>, { let pt = P::prox_type(); @@ -1533,7 +1543,7 @@ } } -pub fn run_fb_pair( +pub fn run_fb_pair( f: &Dat, reg: &Reg, prox_penalty: &P, @@ -1542,7 +1552,7 @@ &AlgorithmConfig, I, Plot, - (Option>, Z), + (Option>, Z), String, ), cont: impl FnOnce( @@ -1550,32 +1560,34 @@ &AlgorithmConfig, I, Plot, - (Option>, Z), + (Option>, Z), String, ), - ) -> DynResult, Z>>, -) -> DynResult, Z>> + ) -> DynResult, Z>>, +) -> DynResult, Z>> where F: Float + ToNalgebraRealField, + U: Space + Clone + Dist, + for<'a> &'a U: Instance, I: AlgIteratorFactory>, - Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + BoundedCurvature, - S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, - RNDM: SpikeMerging, - Reg: SlidingRegTerm, F>, - P: TransportProxPenalty, S, Reg, F>, + S: DifferentiableMapping + ClosedMul + MinMaxMapping, + DiscreteMeasure: SpikeMerging, + Reg: SlidingRegTerm, + P: TransportProxPenalty, for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, Z: ClosedEuclidean + AXPY + Clone, for<'b> &'b Z: Instance, R: Prox, - Plot: Plotter>, + Plot: Plotter>, // 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, &mut FullSpace, cont) } -pub fn run_fb_pair_dom( +pub fn run_fb_pair_dom( f: &Dat, reg: &Reg, prox_penalty: &P, @@ -1584,34 +1596,36 @@ &AlgorithmConfig, I, Plot, - (Option>, Z), + (Option>, Z), String, ), - domain: &mut impl AdmissibleDomain>, + domain: &mut impl AdmissibleDomain, cont: impl FnOnce( ( &AlgorithmConfig, I, Plot, - (Option>, Z), + (Option>, Z), String, ), - ) -> DynResult, Z>>, -) -> DynResult, Z>> + ) -> DynResult, Z>>, +) -> DynResult, Z>> where F: Float + ToNalgebraRealField, + U: Space + Clone + Dist, + for<'a> &'a U: Instance, I: AlgIteratorFactory>, - Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + BoundedCurvature, - S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, - RNDM: SpikeMerging, - Reg: SlidingRegTerm, F>, - P: TransportProxPenalty, S, Reg, F>, + S: DifferentiableMapping + ClosedMul + MinMaxMapping, + DiscreteMeasure: SpikeMerging, + Reg: SlidingRegTerm, + P: TransportProxPenalty, for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, Z: ClosedEuclidean + AXPY + Clone, for<'b> &'b Z: Instance, R: Prox, - Plot: Plotter>, + Plot: Plotter>, // We should not need to explicitly require this: for<'b> &'b Loc<0, F>: Instance>, {