src/forward_model.rs

branch
dev
changeset 49
6b0db7251ebe
parent 44
03251c546744
equal deleted inserted replaced
48:53136eba9abf 49:6b0db7251ebe
1 /*! 1 /*!
2 Forward models from discrete measures to observations. 2 Forward models from discrete measures to observations.
3 */ 3 */
4 4
5 use alg_tools::error::DynError;
6 use alg_tools::euclidean::Euclidean;
7 use alg_tools::instance::Instance;
5 pub use alg_tools::linops::*; 8 pub use alg_tools::linops::*;
6 use alg_tools::euclidean::Euclidean; 9 use alg_tools::norms::{Norm, NormExponent, L2};
7 use alg_tools::error::DynError;
8 use alg_tools::instance::Instance;
9 use alg_tools::norms::{NormExponent, L2, Norm};
10 10
11 use crate::measures::Radon;
11 use crate::types::*; 12 use crate::types::*;
12 use crate::measures::Radon; 13 pub mod bias;
13 pub mod sensor_grid; 14 pub mod sensor_grid;
14 pub mod bias;
15 15
16 /// `ForwardeModel`s are bounded preadjointable linear operators $A ∈ 𝕃(𝒵(Ω); E)$ 16 /// `ForwardeModel`s are bounded preadjointable linear operators $A ∈ 𝕃(𝒵(Ω); E)$
17 /// where $𝒵(Ω) ⊂ ℳ(Ω)$ is the space of sums of delta measures, presented by 17 /// where $𝒵(Ω) ⊂ ℳ(Ω)$ is the space of sums of delta measures, presented by
18 /// [`crate::measures::DiscreteMeasure`], and $E$ is a [`Euclidean`] space. 18 /// [`crate::measures::DiscreteMeasure`], and $E$ is a [`Euclidean`] space.
19 pub trait ForwardModel<Domain : Space, F : Float = f64, E : NormExponent = Radon> 19 pub trait ForwardModel<Domain: Space, F: Float = f64, E: NormExponent = Radon>:
20 : BoundedLinear<Domain, E, L2, F, Codomain=Self::Observable> 20 BoundedLinear<Domain, E, L2, F, Codomain = Self::Observable>
21 + GEMV<F, Domain, Self::Observable> 21 + GEMV<F, Domain, Self::Observable>
22 + Preadjointable<Domain, Self::Observable> 22 + Preadjointable<Domain, Self::Observable>
23 where 23 where
24 for<'a> Self::Observable : Instance<Self::Observable>, 24 for<'a> Self::Observable: Instance<Self::Observable>,
25 Domain : Norm<F, E>, 25 Domain: Norm<F, E>,
26 { 26 {
27 /// The codomain or value space (of “observables”) for this operator. 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) 28 /// It is assumed to be a [`Euclidean`] space, and therefore also (identified with)
29 /// the domain of the preadjoint. 29 /// the domain of the preadjoint.
30 type Observable : Euclidean<F, Output=Self::Observable> 30 type Observable: Euclidean<F, Output = Self::Observable> + AXPY<F> + Space + Clone;
31 + AXPY<F>
32 + Space
33 + Clone;
34 31
35 /// Write an observable into a file. 32 /// Write an observable into a file.
36 fn write_observable(&self, b : &Self::Observable, prefix : String) -> DynError; 33 fn write_observable(&self, b: &Self::Observable, prefix: String) -> DynError;
37 34
38 /// Returns a zero observable 35 /// Returns a zero observable
39 fn zero_observable(&self) -> Self::Observable; 36 fn zero_observable(&self) -> Self::Observable;
40 } 37 }
41 38
42 /// Trait for operators $A$ for which $A_*A$ is bounded by some other operator. 39 /// Trait for operators $A$ for which $A_*A$ is bounded by some other operator.
43 pub trait AdjointProductBoundedBy<Domain : Space, D> : Linear<Domain> { 40 pub trait AdjointProductBoundedBy<Domain: Space, D>: Linear<Domain> {
44 type FloatType : Float; 41 type FloatType: Float;
45 /// Return $L$ such that $A_*A ≤ LD$. 42 /// Return $L$ such that $A_*A ≤ LD$.
46 fn adjoint_product_bound(&self, other : &D) -> Option<Self::FloatType>; 43 fn adjoint_product_bound(&self, other: &D) -> Option<Self::FloatType>;
47 } 44 }
48 45
49 /// Trait for operators $A$ for which $A_*A$ is bounded by a diagonal operator. 46 /// Trait for operators $A$ for which $A_*A$ is bounded by a diagonal operator.
50 pub trait AdjointProductPairBoundedBy<Domain : Space, D1, D2> : Linear<Domain> { 47 pub trait AdjointProductPairBoundedBy<Domain: Space, D1, D2>: Linear<Domain> {
51 type FloatType : Float; 48 type FloatType: Float;
52 /// Return $(L, L_z)$ such that $A_*A ≤ (L_1 D_1, L_2 D_2)$. 49 /// 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) 50 fn adjoint_product_pair_bound(
54 -> Option<(Self::FloatType, Self::FloatType)>; 51 &self,
52 other1: &D1,
53 other_2: &D2,
54 ) -> Option<(Self::FloatType, Self::FloatType)>;
55 } 55 }
56 56
57 /* 57 /*
58 /// Trait for [`ForwardModel`]s whose preadjoint has Lipschitz values. 58 /// Trait for [`ForwardModel`]s whose preadjoint has Lipschitz values.
59 pub trait LipschitzValues { 59 pub trait LipschitzValues {
70 None 70 None
71 } 71 }
72 } 72 }
73 */ 73 */
74 74
75 /// Trait for [`ForwardModel`]s that satisfy bounds on the curvature $𝒦_F$. 75 /// Trait for [`ForwardModel`]s that satisfy bounds on curvature.
76 pub trait BoundedCurvature { 76 pub trait BoundedCurvature {
77 type FloatType : Float; 77 type FloatType: Float;
78 78
79 /// Returns components for a bound $ℓ_F$ on the curvature 79 /// Returns factor $ℓ_F$ and $ℓ_r$ such that
80 /// $$ 80 /// $B_{F'(μ)} dγ ≤ ℓ_F c_2$ and $⟨F'(μ)+F'(μ+Δ)|Δ⟩ ≤ ℓ_r|γ|(c_2)$,
81 /// 𝒦_F(μ, γ) = ∫ B_{F'(μ)} dγ + B_F(μ, μ+Δ). 81 /// where $Δ=(π_♯^1-π_♯^0)γ$.
82 /// $$
83 /// such that $𝒦_F(μ, γ) ≤ ℓ_F ∫ c_2 d|γ|$.
84 fn curvature_bound_components(&self) -> (Option<Self::FloatType>, Option<Self::FloatType>); 82 fn curvature_bound_components(&self) -> (Option<Self::FloatType>, Option<Self::FloatType>);
85 } 83 }

mercurial