pub struct Node<'a, T: Aabb> {
pub range: AabbPin<&'a mut [T]>,
pub cont: Range<T::Num>,
pub div: Option<T::Num>,
pub num_elem: usize,
}
Fields
range: AabbPin<&'a mut [T]>
May or may not be sorted.
cont: Range<T::Num>
if range is empty, then value is [default,default]
.
if range is not empty, then cont is the min max bounds in on the y axis (if the node belongs to the x axis).
div: Option<T::Num>
for non leafs: if there is a bot either in this node or in a child node, then div is some.
for leafs: value is none
num_elem: usize
The minimum number of elements in a child node. If the left child has 500 bots, and the right child has 20, then this value will be 20.
This is used to determine when to start a parallel task. Starting a parallel task has overhead so we only want to split one off if we know that both threads have a decent amount of work to perform in parallel.
Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Node<'a, T> where
T: RefUnwindSafe,
<T as Aabb>::Num: RefUnwindSafe,
impl<'a, T> Send for Node<'a, T> where
T: Send,
<T as Aabb>::Num: Send,
impl<'a, T> Sync for Node<'a, T> where
T: Sync,
<T as Aabb>::Num: Sync,
impl<'a, T> Unpin for Node<'a, T> where
<T as Aabb>::Num: Unpin,
impl<'a, T> !UnwindSafe for Node<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more