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,
}
Expand description
A node in Tree
.
Fields§
§range: AabbPin<&'a mut [T]>
§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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Node<'a, T>
impl<'a, T> RefUnwindSafe for Node<'a, T>
impl<'a, T> Send for Node<'a, T>
impl<'a, T> Sync for Node<'a, T>
impl<'a, T> Unpin for Node<'a, T>
impl<'a, T> !UnwindSafe for Node<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more