diff -r afb3ce40cff6 -r 66b8ac0ebe00 src/sliding_pdps.rs --- a/src/sliding_pdps.rs Thu Jul 30 09:27:44 2026 -0500 +++ b/src/sliding_pdps.rs Fri Jul 31 10:41:47 2026 -0500 @@ -67,9 +67,10 @@ /// Iteratively solve the pointsource localisation with an additional variable /// using sliding primal-dual proximal splitting /// -/// The parametrisation is as for [`crate::forward_pdps::pointsource_forward_pdps_pair`]. +/// The parametrisation is as for [`crate::forward_pdps::pointsource_forward_pdps_pair`], +/// except an additional domain restriction may be given. #[replace_float_literals(F::cast_from(literal))] -pub fn pointsource_sliding_pdps_pair< +pub fn pointsource_sliding_pdps_pair_dom< F, I, S, @@ -95,6 +96,7 @@ opKz: &KOpZ, fnR: &R, fnH: &H, + domain: Option<&P::Dom>, ) -> DynResult> where F: Float + ToNalgebraRealField, @@ -236,6 +238,7 @@ &mut τθ_or_adaptive, &v, &config.transport, + domain, ); let mut attempts = 0; @@ -382,6 +385,144 @@ /// The implementation uses [`pointsource_sliding_pdps_pair`] with appropriate dummy /// variables, operators, and functions. #[replace_float_literals(F::cast_from(literal))] +pub fn pointsource_sliding_fb_pair_dom( + f: &Dat, + reg: &Reg, + prox_penalty: &P, + config: &SlidingFBConfig, + iterator: I, + plotter: Plot, + (μ0, z): (Option>, Z), + //opKμ : KOpM, + fnR: &R, + domain: Option<&P::Dom> +) -> DynResult> +where + F: Float + ToNalgebraRealField, + I: AlgIteratorFactory>, + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + + BoundedCurvature, + S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, + RNDM: SpikeMerging, + Reg: SlidingRegTerm, F>, + P: TransportProxPenalty, S, Reg, F>, + for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, + Z: ClosedEuclidean + AXPY + Clone, + for<'b> &'b Z: Instance, + R: Prox, + Plot: Plotter>, + // We should not need to explicitly require this: + for<'b> &'b Loc<0, F>: Instance>, + // Loc<0, F>: StaticEuclidean> + // + Instance> + // + VectorSpace, +{ + let opKz: ZeroOp, _, _, F> = + ZeroOp::new_dualisable(StaticEuclideanOriginGenerator, z.dual_origin()); + let fnH = Zero::new(); + // Convert config. We don't implement From (that could be done with the o2o crate), as σd0 + // needs to be chosen in a general case; for the problem of this fucntion, anything is valid. + let &SlidingFBConfig { τ0, σp0, insertion, transport, guess } = config; + let pdps_config = SlidingPDPSConfig { τ0, σp0, insertion, transport, guess, σd0: 0.0 }; + + pointsource_sliding_pdps_pair_dom( + f, + reg, + prox_penalty, + &pdps_config, + iterator, + plotter, + (μ0, z, Loc([])), + &opKz, + fnR, + &fnH, + domain + ) +} + + +#[deprecated] +/// Version of [`pointsource_sliding_pdps_pair`] without domain specification. +#[replace_float_literals(F::cast_from(literal))] +pub fn pointsource_sliding_pdps_pair< + F, + I, + S, + Dat, + Reg, + P, + Z, + R, + Y, + Plot, + /*KOpM, */ KOpZ, + H, + const N: usize, +>( + f: &Dat, + reg: &Reg, + prox_penalty: &P, + config: &SlidingPDPSConfig, + iterator: I, + plotter: Plot, + init: (Option>, Z, Y), + //opKμ : KOpM, + opKz: &KOpZ, + fnR: &R, + fnH: &H, +) -> DynResult> +where + F: Float + ToNalgebraRealField, + I: AlgIteratorFactory>, + Dat: DifferentiableMapping, Codomain = F, DerivativeDomain = Pair> + + BoundedCurvature, + S: DifferentiableRealMapping + ClosedMul + MinMaxMapping, F>, + for<'a> Pair<&'a P, &'a IdOp>: StepLengthBoundPair, + //Pair: ClosedMul, + RNDM: SpikeMerging, + Reg: SlidingRegTerm, F>, + P: TransportProxPenalty, S, Reg, F>, + // KOpM : Linear, Codomain=Y> + // + GEMV> + // + Preadjointable< + // RNDM, Y, + // PreadjointCodomain = S, + // > + // + TransportLipschitz + // + AdjointProductBoundedBy, 𝒟, FloatType=F>, + // for<'b> KOpM::Preadjoint<'b> : GEMV, + // Since Z is Hilbert, we may just as well use adjoints for K_z. + KOpZ: BoundedLinear + + GEMV + + SimplyAdjointable, + KOpZ::SimpleAdjoint: GEMV, + Y: ClosedEuclidean, + for<'b> &'b Y: Instance, + Z: ClosedEuclidean + AXPY, + for<'b> &'b Z: Instance, + R: Prox, + H: Conjugable, + for<'b> H::Conjugate<'b>: Prox, + Plot: Plotter>, +{ + pointsource_sliding_pdps_pair_dom( + f, + reg, + prox_penalty, + config, + iterator, + plotter, + init, + opKz, + fnR, + fnH, + None, + ) +} + +#[deprecated] +/// Version of [`pointsource_sliding_fb_pair_dom`] without domain specification +#[replace_float_literals(F::cast_from(literal))] pub fn pointsource_sliding_fb_pair( f: &Dat, reg: &Reg, @@ -421,7 +562,7 @@ let &SlidingFBConfig { τ0, σp0, insertion, transport, guess } = config; let pdps_config = SlidingPDPSConfig { τ0, σp0, insertion, transport, guess, σd0: 0.0 }; - pointsource_sliding_pdps_pair( + pointsource_sliding_pdps_pair_dom( f, reg, prox_penalty, @@ -432,5 +573,6 @@ &opKz, fnR, &fnH, + None ) }