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 { |