src/bisection_tree/bt.rs

branch
dev
changeset 97
4e80fb049dca
parent 96
962c8e346ab9
child 124
6aa955ad8122
--- a/src/bisection_tree/bt.rs	Sun Apr 27 15:45:40 2025 -0500
+++ b/src/bisection_tree/bt.rs	Sun Apr 27 15:56:43 2025 -0500
@@ -246,7 +246,10 @@
 {
     /// Creates a new node branching structure, subdividing `domain` based on the
     /// [hint][Support::support_hint] of `support`.
-    pub(super) fn new_with<S: LocalAnalysis<F, A, N>>(domain: &Cube<F, N>, support: &S) -> Self {
+    pub(super) fn new_with<S: LocalAnalysis<F, A, N> + Support<F, N>>(
+        domain: &Cube<F, N>,
+        support: &S,
+    ) -> Self {
         let hint = support.bisection_hint(domain);
         let branch_at = map2(&hint, domain, |h, r| {
             h.unwrap_or_else(|| (r[0] + r[1]) / F::TWO)
@@ -329,7 +332,7 @@
     ///  * `support` is the [`Support`] that is used determine with which subcubes of `domain`
     ///     (at subdivision depth `new_leaf_depth`) the data `d` is to be associated with.
     ///
-    pub(super) fn insert<'refs, 'scope, M: Depth, S: LocalAnalysis<F, A, N>>(
+    pub(super) fn insert<'refs, 'scope, M: Depth, S: LocalAnalysis<F, A, N> + Support<F, N>>(
         &mut self,
         domain: &Cube<F, N>,
         d: D,
@@ -456,7 +459,7 @@
     /// If `self` is a [`NodeOption::Branches`], the data is passed to branches whose subcubes
     /// `support` intersects. If an [`NodeOption::Uninitialised`] node is encountered, a new leaf is
     /// created at a minimum depth of `new_leaf_depth`.
-    pub(super) fn insert<'refs, 'scope, M: Depth, S: LocalAnalysis<F, A, N>>(
+    pub(super) fn insert<'refs, 'scope, M: Depth, S: LocalAnalysis<F, A, N> + Support<F, N>>(
         &mut self,
         domain: &Cube<F, N>,
         d: D,
@@ -626,7 +629,11 @@
     ///
     /// Every leaf node of the tree that intersects the `support` will contain a copy of
     /// `d`.
-    fn insert<S: LocalAnalysis<F, Self::Agg, N>>(&mut self, d: Self::Data, support: &S);
+    fn insert<S: LocalAnalysis<F, Self::Agg, N> + Support<F, N>>(
+        &mut self,
+        d: Self::Data,
+        support: &S,
+    );
 
     /// Construct a new instance of the tree for a different aggregator
     ///
@@ -696,7 +703,7 @@
             type Agg = A;
             type Converted<ANew> = BT<M,F,D,ANew,$n> where ANew : Aggregator;
 
-            fn insert<S: LocalAnalysis<F, A, $n>>(
+            fn insert<S: LocalAnalysis<F, A, $n> + Support<F, $n>>(
                 &mut self,
                 d : D,
                 support : &S

mercurial