| 1 /*! |
1 /*! |
| 2 Basic proximal penalty based on convolution operators $𝒟$. |
2 Basic proximal penalty based on convolution operators $𝒟$. |
| 3 */ |
3 */ |
| 4 |
4 |
| 5 use super::{InsertionConfig, ProxPenalty, ProxTerm, StepLengthBound, StepLengthBoundPD}; |
5 use super::{ |
| |
6 InsertionConfig, ProxPenalty, ProxTerm, StepLengthBound, StepLengthBoundPD, |
| |
7 StepLengthBoundValue, |
| |
8 }; |
| 6 use crate::dataterm::QuadraticDataTerm; |
9 use crate::dataterm::QuadraticDataTerm; |
| 7 use crate::forward_model::ForwardModel; |
10 use crate::forward_model::ForwardModel; |
| 8 use crate::measures::merging::SpikeMerging; |
11 use crate::measures::merging::SpikeMerging; |
| 9 use crate::measures::{DeltaMeasure, DiscreteMeasure, Radon}; |
12 use crate::measures::{DeltaMeasure, DiscreteMeasure, Radon}; |
| 10 use crate::regularisation::RegTerm; |
13 use crate::regularisation::RegTerm; |
| 192 for<'b> &'b 𝒟: NormExponent, |
195 for<'b> &'b 𝒟: NormExponent, |
| 193 { |
196 { |
| 194 fn step_length_bound( |
197 fn step_length_bound( |
| 195 &self, |
198 &self, |
| 196 f: &QuadraticDataTerm<F, DiscreteMeasure<Domain, F>, A>, |
199 f: &QuadraticDataTerm<F, DiscreteMeasure<Domain, F>, A>, |
| 197 ) -> DynResult<F> { |
200 ) -> StepLengthBoundValue<F> { |
| 198 // TODO: direct squared calculation |
201 match f.operator().opnorm_bound(self, L2) { |
| 199 Ok(f.operator().opnorm_bound(self, L2)?.powi(2)) |
202 Err(_) => StepLengthBoundValue::Failure, |
| |
203 Ok(l) => StepLengthBoundValue::LipschitzFactor(l.powi(2)), |
| |
204 } |
| 200 } |
205 } |
| 201 } |
206 } |
| 202 |
207 |
| 203 #[replace_float_literals(F::cast_from(literal))] |
208 #[replace_float_literals(F::cast_from(literal))] |
| 204 impl<F, A, 𝒟, Domain> StepLengthBoundPD<F, A, DiscreteMeasure<Domain, F>> for 𝒟 |
209 impl<F, A, 𝒟, Domain> StepLengthBoundPD<F, A, DiscreteMeasure<Domain, F>> for 𝒟 |