src/bisection_tree/support.rs

branch
dev
changeset 150
c4e394a9c84c
parent 124
6aa955ad8122
child 151
402d717bb5c0
--- a/src/bisection_tree/support.rs	Mon Sep 01 00:04:22 2025 -0500
+++ b/src/bisection_tree/support.rs	Mon Sep 01 13:51:03 2025 -0500
@@ -4,7 +4,9 @@
 use super::aggregator::Bounds;
 pub use crate::bounds::{GlobalAnalysis, LocalAnalysis};
 use crate::loc::Loc;
-use crate::mapping::{DifferentiableImpl, DifferentiableMapping, Instance, Mapping, Space};
+use crate::mapping::{
+    ClosedSpace, DifferentiableImpl, DifferentiableMapping, Instance, Mapping, Space,
+};
 use crate::maputil::map2;
 use crate::norms::{Linfinity, Norm, L1, L2};
 pub use crate::operator_arithmetic::{Constant, Weighted};
@@ -46,10 +48,7 @@
     /// Translate `self` by `x`.
     #[inline]
     fn shift(self, x: Loc<N, F>) -> Shift<Self, N, F> {
-        Shift {
-            shift: x,
-            base_fn: self,
-        }
+        Shift { shift: x, base_fn: self }
     }
 }
 
@@ -60,7 +59,7 @@
     base_fn: T,
 }
 
-impl<'a, T, V: Space, F: Float, const N: usize> Mapping<Loc<N, F>> for Shift<T, N, F>
+impl<'a, T, V: ClosedSpace, F: Float, const N: usize> Mapping<Loc<N, F>> for Shift<T, N, F>
 where
     T: Mapping<Loc<N, F>, Codomain = V>,
 {
@@ -72,7 +71,8 @@
     }
 }
 
-impl<'a, T, V: Space, F: Float, const N: usize> DifferentiableImpl<Loc<N, F>> for Shift<T, N, F>
+impl<'a, T, V: ClosedSpace, F: Float, const N: usize> DifferentiableImpl<Loc<N, F>>
+    for Shift<T, N, F>
 where
     T: DifferentiableMapping<Loc<N, F>, DerivativeDomain = V>,
 {
@@ -226,10 +226,7 @@
             type Output = Weighted<T, F>;
             #[inline]
             fn $fn(self, t: F) -> Self::Output {
-                Weighted {
-                    weight: self.weight.$fn(t),
-                    base_fn: self.base_fn.clone(),
-                }
+                Weighted { weight: self.weight.$fn(t), base_fn: self.base_fn.clone() }
             }
         }
     };

mercurial