src/bisection_tree/refine.rs

branch
dev
changeset 86
d5b0e496b72f
parent 55
7b2ee3e84c5f
--- a/src/bisection_tree/refine.rs	Mon Dec 30 15:46:28 2024 -0500
+++ b/src/bisection_tree/refine.rs	Mon Jan 06 20:29:25 2025 -0500
@@ -3,6 +3,7 @@
 use std::cmp::{PartialOrd, Ord, Ordering, Ordering::*, max};
 use std::marker::PhantomData;
 use std::sync::{Arc, Mutex, MutexGuard, Condvar};
+use serde::{Serialize, Deserialize};
 use crate::types::*;
 use crate::nanleast::NaNLeast;
 use crate::sets::Cube;
@@ -35,12 +36,20 @@
 /// An [`AggregatorSorting`] for [`Bounds`], using the upper/lower bound as the upper/lower key.
 ///
 /// See [`LowerBoundSorting`] for the opposite ordering.
-pub struct UpperBoundSorting<F : Float>(PhantomData<F>);
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct UpperBoundSorting<F : Float>(
+    #[serde(skip)]
+    PhantomData<F>
+);
 
 /// An [`AggregatorSorting`] for [`Bounds`], using the upper/lower bound as the lower/upper key.
 ///
 /// See [`UpperBoundSorting`] for the opposite ordering.
-pub struct LowerBoundSorting<F : Float>(PhantomData<F>);
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct LowerBoundSorting<F : Float>(
+    #[serde(skip)]
+    PhantomData<F>
+);
 
 impl<F : Float> AggregatorSorting for UpperBoundSorting<F> {
     type Agg = Bounds<F>;
@@ -136,6 +145,7 @@
 }
 
 /// Structure for tracking the refinement process in a [`BinaryHeap`].
+#[derive(Debug)]
 struct RefinementInfo<'a, F, D, A, S, RResult, const N : usize, const P : usize>
 where F : Float,
       D : 'static,
@@ -228,6 +238,7 @@
 /// This is a container for a [`BinaryHeap`] of [`RefinementInfo`]s together with tracking of
 /// the greatest lower bound of the [`Aggregator`]s of the [`Node`]s therein accroding to
 /// chosen [`AggregatorSorting`].
+#[derive(Debug)]
 struct HeapContainer<'a, F, D, A, S, RResult, const N : usize, const P : usize>
 where F : Float,
       D : 'static + Copy,

mercurial