diff -r c5d8bd1a7728 -r 6316d68b58af src/forward_model/sensor_grid.rs --- a/src/forward_model/sensor_grid.rs Thu Jan 23 23:35:28 2025 +0100 +++ b/src/forward_model/sensor_grid.rs Thu Jan 23 23:34:05 2025 +0100 @@ -94,7 +94,8 @@ S : Sensor, P : Spread, Convolution : Spread, - BT : SensorGridBT, { + BT : SensorGridBT, +{ domain : Cube, sensor_count : [usize; N], sensor : S, @@ -109,7 +110,7 @@ S : Sensor, P : Spread, Convolution : Spread + LocalAnalysis, - /*ShiftedSensor : LocalAnalysis*/ { +{ /// Create a new sensor grid. /// @@ -148,7 +149,8 @@ BT : SensorGridBT, S : Sensor, P : Spread, - Convolution : Spread { + Convolution : Spread +{ /// Return the grid of sensor locations. pub fn grid(&self) -> LinGrid { @@ -190,7 +192,6 @@ S : Sensor, P : Spread, Convolution : Spread, - //ShiftedSensor : LocalAnalysis, { type Codomain = DVector; @@ -211,7 +212,6 @@ S : Sensor, P : Spread, Convolution : Spread, - //ShiftedSensor : LocalAnalysis { } @@ -222,7 +222,6 @@ S : Sensor, P : Spread, Convolution : Spread, - //ShiftedSensor : LocalAnalysis { fn gemv>>( @@ -268,8 +267,8 @@ BT : SensorGridBT>, S : Sensor, P : Spread, - Convolution : Spread, - ShiftedSensor : LocalAnalysis { + Convolution : Spread + LocalAnalysis +{ /// An estimate on the operator norm in $𝕃(ℳ(Ω); ℝ^n)$ with $ℳ(Ω)$ equipped /// with the Radon norm, and $ℝ^n$ with the Euclidean norm. @@ -278,11 +277,14 @@ // |Aμ|_2 = sup_{|z|_2 ≤ 1} ⟨z,Αμ⟩ = sup_{|z|_2 ≤ 1} ⟨A^*z|μ⟩ // ≤ sup_{|z|_2 ≤ 1} |A^*z|_∞ |μ|_ℳ // = sup_{|z|_2 ≤ 1} |∑ φ(· - x_i)z_i|_∞ |μ|_ℳ - // ≤ sup_{|z|_2 ≤ 1} |φ|_∞ ∑ |z_i| |μ|_ℳ - // ≤ sup_{|z|_2 ≤ 1} |φ|_∞ √n |z|_2 |μ|_ℳ - // = |φ|_∞ √n |μ|_ℳ. + // ≤ sup_{|z|_2 ≤ 1} |φ(y)| ∑_{i:th sensor active at y}|z_i| |μ|_ℳ + // where the supremum of |∑ φ(· - x_i)z_i|_∞ is reached at y + // ≤ sup_{|z|_2 ≤ 1} |φ|_∞ √N_ψ |z|_2 |μ|_ℳ + // where N_ψ is the maximum number of sensors that overlap, and + // |z|_2 is restricted to the active sensors. + // = |φ|_∞ √N_ψ |μ|_ℳ. // Hence - let n = F::cast_from(self.n_sensors()); + let n = self.max_overlapping(); self.base_sensor.bounds().uniform() * n.sqrt() } } @@ -297,9 +299,8 @@ BT : SensorGridBT, S : Sensor, P : Spread, - Convolution : Spread + LocalAnalysis, - /*ShiftedSensor : LocalAnalysis, - Weighted, F> : LocalAnalysis*/ { + Convolution : Spread + LocalAnalysis +{ type PreadjointCodomain = BTFN, BT, N>; type Preadjoint<'a> = SensorGridPreadjoint<'a, Self, F, N> where Self : 'a; @@ -317,8 +318,7 @@ P : Spread, Convolution : Spread + Lipschitz + DifferentiableMapping> + LocalAnalysis, for<'b> as DifferentiableMapping>>::Differential<'b> : Lipschitz, - /*ShiftedSensor : LocalAnalysis, - Weighted, F> : LocalAnalysis*/ { +{ type FloatType = F; @@ -345,7 +345,8 @@ pub struct SensorGridSupportGenerator where F : Float, S : Sensor, - P : Spread { + P : Spread +{ base_sensor : Convolution, grid : LinGrid, weights : DVector @@ -355,7 +356,8 @@ where F : Float, S : Sensor, P : Spread, - Convolution : Spread { + Convolution : Spread +{ #[inline] fn construct_sensor(&self, id : usize, w : F) -> Weighted, F> { @@ -375,7 +377,8 @@ where F : Float, S : Sensor, P : Spread, - Convolution : Spread { + Convolution : Spread +{ type Id = usize; type SupportType = Weighted, F>; type AllDataIter<'a> = MapX<'a, Zip, @@ -407,8 +410,7 @@ S : Sensor, P : Spread, Convolution : Spread + LocalAnalysis, - /*ShiftedSensor : LocalAnalysis, - Weighted, F> : LocalAnalysis*/ { +{ type Observable = DVector; fn write_observable(&self, b : &Self::Observable, prefix : String) -> DynError { @@ -428,9 +430,8 @@ BT : SensorGridBT, S : Sensor, P : Spread, - Convolution : Spread + LocalAnalysis, - /*ShiftedSensor : LocalAnalysis, - Weighted, F> : LocalAnalysis*/ { + Convolution : Spread + LocalAnalysis +{ fn findim_quadratic_model( &self, @@ -465,7 +466,8 @@ P : Spread, Convolution : Spread, K : SimpleConvolutionKernel, - AutoConvolution

: BoundedBy { + AutoConvolution

: BoundedBy +{ type FloatType = F; @@ -496,7 +498,8 @@ BT : SensorGridBT, S : Sensor, P : Spread, - Convolution : Spread + Lipschitz { + Convolution : Spread + Lipschitz +{ type FloatType = F; fn transport_lipschitz_factor(&self, L2Squared : L2Squared) -> Self::FloatType { @@ -604,8 +607,7 @@ S : Sensor, P : Spread, Convolution : Spread + LocalAnalysis, N>, - //ShiftedSensor : LocalAnalysis, - /*Weighted, F> : LocalAnalysis*/ { +{ type Codomain = SensorGridBTFN; @@ -627,8 +629,4 @@ S : Sensor, P : Spread, Convolution : Spread + LocalAnalysis, N>, - /*ShiftedSensor : LocalAnalysis, - Weighted, F> : LocalAnalysis*/ { - -} - +{ }