src/forward_model.rs

branch
dev
changeset 32
56c8adc32b09
parent 0
eb3c7813b67a
child 34
efa60bc4f743
--- a/src/forward_model.rs	Fri Apr 28 13:15:19 2023 +0300
+++ b/src/forward_model.rs	Tue Dec 31 09:34:24 2024 -0500
@@ -14,7 +14,7 @@
 pub use alg_tools::linops::*;
 use alg_tools::euclidean::Euclidean;
 use alg_tools::norms::{
-    L1, Linfinity, Norm
+    L1, Linfinity, L2, Norm
 };
 use alg_tools::bisection_tree::*;
 use alg_tools::mapping::RealMapping;
@@ -27,7 +27,6 @@
 use crate::types::*;
 use crate::measures::*;
 use crate::seminorms::{
-    Lipschitz,
     ConvolutionOp,
     SimpleConvolutionKernel,
 };
@@ -36,6 +35,8 @@
     AutoConvolution,
     BoundedBy,
 };
+use crate::types::L2Squared;
+use crate::transport::TransportLipschitz;
 
 pub type RNDM<F, const N : usize> = DiscreteMeasure<Loc<F,N>, F>;
 
@@ -558,7 +559,7 @@
 ///
 /// **This assumes (but does not check) that the sensors are not overlapping.**
 #[replace_float_literals(F::cast_from(literal))]
-impl<F, BT, S, P, K, const N : usize> Lipschitz<ConvolutionOp<F, K, BT, N>>
+impl<'a, F, BT, S, P, K, const N : usize> Lipschitz<&'a ConvolutionOp<F, K, BT, N>>
 for SensorGrid<F, S, P, BT, N>
 where F : Float + nalgebra::RealField + ToNalgebraRealField,
       BT : SensorGridBT<F, S, P, N>,
@@ -570,7 +571,7 @@
 
     type FloatType = F;
 
-    fn lipschitz_factor(&self, seminorm : &ConvolutionOp<F, K, BT, N>) -> Option<F> {
+    fn lipschitz_factor(&self, seminorm : &'a ConvolutionOp<F, K, BT, N>) -> Option<F> {
         // Sensors should not take on negative values to allow
         // A_*A to be upper bounded by a simple convolution of `spread`.
         if self.sensor.bounds().lower() < 0.0 {
@@ -590,6 +591,22 @@
     }
 }
 
+#[replace_float_literals(F::cast_from(literal))]
+impl<F, BT, S, P, const N : usize> TransportLipschitz<L2Squared>
+for SensorGrid<F, S, P, BT, N>
+where F : Float + nalgebra::RealField + ToNalgebraRealField,
+      BT : SensorGridBT<F, S, P, N>,
+      S : Sensor<F, N>,
+      P : Spread<F, N>,
+      Convolution<S, P> : Spread<F, N> + Lipschitz<L2> {
+    type FloatType = F;
+
+    fn transport_lipschitz_factor(&self, L2Squared : L2Squared) -> Self::FloatType {
+        todo!("Unimplemented")
+    }
+}
+
+
 macro_rules! make_sensorgridsupportgenerator_scalarop_rhs {
     ($trait:ident, $fn:ident, $trait_assign:ident, $fn_assign:ident) => {
         impl<F, S, P, const N : usize>

mercurial