105 } |
105 } |
106 |
106 |
107 /// Settings for [`pointsource_pdps`]. |
107 /// Settings for [`pointsource_pdps`]. |
108 #[derive(Clone, Copy, Eq, PartialEq, Serialize, Deserialize, Debug)] |
108 #[derive(Clone, Copy, Eq, PartialEq, Serialize, Deserialize, Debug)] |
109 #[serde(default)] |
109 #[serde(default)] |
110 pub struct PDPSConfig<F : Float> { |
110 pub struct PDPSConfig<F : ClapFloat> { |
111 /// Primal step length scaling. We must have `τ0 * σ0 < 1`. |
111 /// Primal step length scaling. We must have `τ0 * σ0 < 1`. |
112 pub τ0 : F, |
112 pub τ0 : F, |
113 /// Dual step length scaling. We must have `τ0 * σ0 < 1`. |
113 /// Dual step length scaling. We must have `τ0 * σ0 < 1`. |
114 pub σ0 : F, |
114 pub σ0 : F, |
115 /// Accelerate if available |
115 /// Accelerate if available |
117 /// Generic parameters |
117 /// Generic parameters |
118 pub insertion : FBGenericConfig<F>, |
118 pub insertion : FBGenericConfig<F>, |
119 } |
119 } |
120 |
120 |
121 #[replace_float_literals(F::cast_from(literal))] |
121 #[replace_float_literals(F::cast_from(literal))] |
122 impl<F : Float> Default for PDPSConfig<F> { |
122 impl<F : ClapFloat> Default for PDPSConfig<F> { |
123 fn default() -> Self { |
123 fn default() -> Self { |
124 let τ0 = 0.5; |
124 let τ0 = 0.5; |
125 PDPSConfig { |
125 PDPSConfig { |
126 τ0, |
126 τ0, |
127 σ0 : 0.99/τ0, |
127 σ0 : 0.99/τ0, |
309 config : &PDPSConfig<F>, |
309 config : &PDPSConfig<F>, |
310 iterator : I, |
310 iterator : I, |
311 plotter : SeqPlotter<F, N>, |
311 plotter : SeqPlotter<F, N>, |
312 dataterm : D, |
312 dataterm : D, |
313 ) -> DiscreteMeasure<Loc<F, N>, F> |
313 ) -> DiscreteMeasure<Loc<F, N>, F> |
314 where F : Float + ToNalgebraRealField, |
314 where F : ClapFloat + ToNalgebraRealField, |
315 I : AlgIteratorFactory<IterInfo<F, N>>, |
315 I : AlgIteratorFactory<IterInfo<F, N>>, |
316 for<'b> &'b A::Observable : std::ops::Neg<Output=A::Observable> |
316 for<'b> &'b A::Observable : std::ops::Neg<Output=A::Observable> |
317 + std::ops::Add<A::Observable, Output=A::Observable>, |
317 + std::ops::Add<A::Observable, Output=A::Observable>, |
318 //+ std::ops::Mul<F, Output=A::Observable>, // <-- FIXME: compiler overflow |
318 //+ std::ops::Mul<F, Output=A::Observable>, // <-- FIXME: compiler overflow |
319 A::Observable : std::ops::MulAssign<F>, |
319 A::Observable : std::ops::MulAssign<F>, |