4 |
4 |
5 use numeric_literals::replace_float_literals; |
5 use numeric_literals::replace_float_literals; |
6 use alg_tools::types::{Float, ClosedAdd}; |
6 use alg_tools::types::{Float, ClosedAdd}; |
7 use alg_tools::mapping::Space; |
7 use alg_tools::mapping::Space; |
8 use alg_tools::direct_product::Pair; |
8 use alg_tools::direct_product::Pair; |
9 use alg_tools::linops::{Linear, RowOp, ColOp, IdOp, ZeroOp, AXPY}; |
9 use alg_tools::linops::{Linear, RowOp, IdOp, ZeroOp, AXPY}; |
10 use alg_tools::error::DynError; |
10 use alg_tools::error::DynError; |
11 use alg_tools::norms::{L2, Norm, PairNorm, NormExponent}; |
11 use alg_tools::norms::{L2, Norm, PairNorm, NormExponent}; |
12 use crate::types::L2Squared; |
|
13 use crate::measures::RNDM; |
12 use crate::measures::RNDM; |
14 use super::{ForwardModel, AdjointProductBoundedBy, AdjointProductPairBoundedBy, LipschitzValues}; |
13 use super::{ForwardModel, AdjointProductBoundedBy, AdjointProductPairBoundedBy, BoundedCurvature}; |
15 use crate::transport::TransportLipschitz; |
|
16 |
14 |
17 impl<Domain, F, A, E> ForwardModel<Pair<Domain, A::Observable>, F, PairNorm<E, L2, L2>> |
15 impl<Domain, F, A, E> ForwardModel<Pair<Domain, A::Observable>, F, PairNorm<E, L2, L2>> |
18 for RowOp<A, IdOp<A::Observable>> |
16 for RowOp<A, IdOp<A::Observable>> |
19 where |
17 where |
20 E : NormExponent, |
18 E : NormExponent, |
54 (2.0 * l_0, 2.0) |
52 (2.0 * l_0, 2.0) |
55 }) |
53 }) |
56 } |
54 } |
57 } |
55 } |
58 |
56 |
|
57 /* |
59 /// This `impl` is bit of an abuse as the codomain of `Apre` is a [`Pair`] of a measure predual, |
58 /// This `impl` is bit of an abuse as the codomain of `Apre` is a [`Pair`] of a measure predual, |
60 /// to which this `impl` applies, and another space. |
59 /// to which this `impl` applies, and another space. |
61 impl<F, Apre, Z> LipschitzValues |
60 impl<F, Apre, Z> LipschitzValues |
62 for ColOp<Apre, IdOp<Z>> |
61 for ColOp<Apre, IdOp<Z>> |
63 where |
62 where |
76 /// $z$ in the unit ball. |
75 /// $z$ in the unit ball. |
77 fn value_diff_unit_lipschitz_factor(&self) -> Option<Self::FloatType> { |
76 fn value_diff_unit_lipschitz_factor(&self) -> Option<Self::FloatType> { |
78 self.0.value_diff_unit_lipschitz_factor() |
77 self.0.value_diff_unit_lipschitz_factor() |
79 } |
78 } |
80 } |
79 } |
|
80 */ |
81 |
81 |
82 |
82 impl<F, A, Z> BoundedCurvature |
83 |
83 for RowOp<A, IdOp<Z>> |
84 impl<'a, F : Float, Y : Space, XD, const N : usize> TransportLipschitz<L2Squared> for |
84 where |
85 ZeroOp<'a, RNDM<F, N>, XD, Y, F> { |
85 F : Float, |
|
86 Z : Clone + Space + ClosedAdd, |
|
87 A : BoundedCurvature<FloatType = F>, |
|
88 { |
86 type FloatType = F; |
89 type FloatType = F; |
87 |
90 |
88 fn transport_lipschitz_factor(&self, _ : L2Squared) -> Self::FloatType { |
91 fn curvature_bound_components(&self) -> (Option<Self::FloatType>, Option<Self::FloatType>) { |
89 F::ZERO |
92 self.0.curvature_bound_components() |
90 } |
93 } |
91 } |
94 } |
92 |
|
93 |
95 |
94 #[replace_float_literals(F::cast_from(literal))] |
96 #[replace_float_literals(F::cast_from(literal))] |
95 impl<'a, F, D, XD, Y, const N : usize> AdjointProductBoundedBy<RNDM<F, N>, D> |
97 impl<'a, F, D, XD, Y, const N : usize> AdjointProductBoundedBy<RNDM<F, N>, D> |
96 for ZeroOp<'a, RNDM<F, N>, XD, Y, F> |
98 for ZeroOp<'a, RNDM<F, N>, XD, Y, F> |
97 where |
99 where |