| 116 spread: P, |
116 spread: P, |
| 117 depth: BT::Depth, |
117 depth: BT::Depth, |
| 118 ) -> Self { |
118 ) -> Self { |
| 119 let base_sensor = Convolution(sensor.clone(), spread.clone()); |
119 let base_sensor = Convolution(sensor.clone(), spread.clone()); |
| 120 let bt = BT::new(domain, depth); |
120 let bt = BT::new(domain, depth); |
| 121 let mut sensorgrid = SensorGrid { |
121 let mut sensorgrid = SensorGrid { domain, sensor_count, sensor, spread, base_sensor, bt }; |
| 122 domain, |
|
| 123 sensor_count, |
|
| 124 sensor, |
|
| 125 spread, |
|
| 126 base_sensor, |
|
| 127 bt, |
|
| 128 }; |
|
| 129 |
122 |
| 130 for (x, id) in sensorgrid.grid().into_iter().zip(0usize..) { |
123 for (x, id) in sensorgrid.grid().into_iter().zip(0usize..) { |
| 131 let s = sensorgrid.shifted_sensor(x); |
124 let s = sensorgrid.shifted_sensor(x); |
| 132 sensorgrid.bt.insert(id, &s); |
125 sensorgrid.bt.insert(id, &s); |
| 133 } |
126 } |
| 347 + DifferentiableMapping<Loc<N, F>> |
340 + DifferentiableMapping<Loc<N, F>> |
| 348 + LocalAnalysis<F, BT::Agg, N>, |
341 + LocalAnalysis<F, BT::Agg, N>, |
| 349 for<'b> <Convolution<S, P> as DifferentiableMapping<Loc<N, F>>>::Differential<'b>: |
342 for<'b> <Convolution<S, P> as DifferentiableMapping<Loc<N, F>>>::Differential<'b>: |
| 350 Lipschitz<L2, FloatType = F>, |
343 Lipschitz<L2, FloatType = F>, |
| 351 { |
344 { |
| 352 fn basic_curvature_bound_components(&self) -> (DynResult<F>, DynResult<F>) { |
345 fn basic_curvature_bound_components(&self) -> (DynResult<F>, DynResult<F>, DynResult<F>) { |
| 353 let n_ψ = self.max_overlapping(); |
346 let n_ψ = self.max_overlapping(); |
| 354 let ψ_diff_lip = self.base_sensor.diff_ref().lipschitz_factor(L2); |
347 let ψ_diff_lip = self.base_sensor.diff_ref().lipschitz_factor(L2); |
| 355 let ψ_lip = self.base_sensor.lipschitz_factor(L2); |
348 let ψ_lip = self.base_sensor.lipschitz_factor(L2); |
| 356 let ℓ_F0 = ψ_diff_lip.map(|l| (2.0 * n_ψ).sqrt() * l); |
349 let ℓ_gradv_0 = ψ_diff_lip.map(|l| n_ψ * l); |
| 357 let Θ2 = ψ_lip.map(|l| 4.0 * n_ψ * l.powi(2)); |
350 let Θ2 = ψ_lip.map(|l| 4.0 * n_ψ * l.powi(2)); |
| 358 |
351 let ℓ_F = Ok(0.0); // convex problem |
| 359 (ℓ_F0, Θ2) |
352 |
| |
353 (ℓ_F, ℓ_gradv_0, Θ2) |
| 360 } |
354 } |
| 361 } |
355 } |
| 362 |
356 |
| 363 #[derive(Clone, Debug)] |
357 #[derive(Clone, Debug)] |
| 364 pub struct SensorGridSupportGenerator<S, F, P, const N: usize> |
358 pub struct SensorGridSupportGenerator<S, F, P, const N: usize> |