Thu, 23 Jan 2025 23:35:28 +0100
Generic proximal penalty support
| 0 | 1 | /*! |
| 2 | Forward models from discrete measures to observations. | |
| 3 | */ | |
| 4 | ||
| 5 | pub use alg_tools::linops::*; | |
| 6 | use alg_tools::euclidean::Euclidean; | |
| 7 | use alg_tools::error::DynError; | |
| 35 | 8 | use alg_tools::instance::Instance; |
| 9 | use alg_tools::norms::{NormExponent, L2, Norm}; | |
| 0 | 10 | |
| 11 | use crate::types::*; | |
| 35 | 12 | use crate::measures::Radon; |
| 13 | pub mod sensor_grid; | |
| 14 | pub mod bias; | |
| 0 | 15 | |
| 16 | /// `ForwardeModel`s are bounded preadjointable linear operators $A ∈ 𝕃(𝒵(Ω); E)$ | |
| 17 | /// where $𝒵(Ω) ⊂ ℳ(Ω)$ is the space of sums of delta measures, presented by | |
| 35 | 18 | /// [`crate::measures::DiscreteMeasure`], and $E$ is a [`Euclidean`] space. |
| 19 | pub trait ForwardModel<Domain : Space, F : Float = f64, E : NormExponent = Radon> | |
| 20 | : BoundedLinear<Domain, E, L2, F, Codomain=Self::Observable> | |
| 21 | + GEMV<F, Domain, Self::Observable> | |
| 22 | + Preadjointable<Domain, Self::Observable> | |
| 23 | where | |
| 24 | for<'a> Self::Observable : Instance<Self::Observable>, | |
| 25 | Domain : Norm<F, E>, | |
| 26 | { | |
| 0 | 27 | /// The codomain or value space (of “observables”) for this operator. |
| 28 | /// It is assumed to be a [`Euclidean`] space, and therefore also (identified with) | |
| 29 | /// the domain of the preadjoint. | |
| 30 | type Observable : Euclidean<F, Output=Self::Observable> | |
| 31 | + AXPY<F> | |
| 35 | 32 | + Space |
| 0 | 33 | + Clone; |
| 34 | ||
| 35 | /// Write an observable into a file. | |
| 36 | fn write_observable(&self, b : &Self::Observable, prefix : String) -> DynError; | |
| 37 | ||
| 38 | /// Returns a zero observable | |
| 39 | fn zero_observable(&self) -> Self::Observable; | |
| 40 | } | |
| 41 | ||
| 35 | 42 | /// Trait for operators $A$ for which $A_*A$ is bounded by some other operator. |
| 43 | pub trait AdjointProductBoundedBy<Domain : Space, D> : Linear<Domain> { | |
| 44 | type FloatType : Float; | |
| 45 | /// Return $L$ such that $A_*A ≤ LD$. | |
| 46 | fn adjoint_product_bound(&self, other : &D) -> Option<Self::FloatType>; | |
| 0 | 47 | } |
| 48 | ||
| 35 | 49 | /// Trait for operators $A$ for which $A_*A$ is bounded by a diagonal operator. |
| 50 | pub trait AdjointProductPairBoundedBy<Domain : Space, D1, D2> : Linear<Domain> { | |
| 51 | type FloatType : Float; | |
| 52 | /// Return $(L, L_z)$ such that $A_*A ≤ (L_1 D_1, L_2 D_2)$. | |
| 53 | fn adjoint_product_pair_bound(&self, other1 : &D1, other_2 : &D2) | |
| 54 | -> Option<(Self::FloatType, Self::FloatType)>; | |
| 0 | 55 | } |
| 56 | ||
| 35 | 57 | /// Trait for [`ForwardModel`]s whose preadjoint has Lipschitz values. |
| 58 | pub trait LipschitzValues { | |
| 59 | type FloatType : Float; | |
| 60 | /// Return (if one exists) a factor $L$ such that $A_*z$ is $L$-Lipschitz for all | |
| 61 | /// $z$ in the unit ball. | |
| 62 | fn value_unit_lipschitz_factor(&self) -> Option<Self::FloatType> { | |
| 63 | None | |
| 0 | 64 | } |
| 65 | ||
| 35 | 66 | /// Return (if one exists) a factor $L$ such that $∇A_*z$ is $L$-Lipschitz for all |
| 67 | /// $z$ in the unit ball. | |
| 68 | fn value_diff_unit_lipschitz_factor(&self) -> Option<Self::FloatType> { | |
| 69 | None | |
| 0 | 70 | } |
| 71 | } | |
| 72 |