pub struct Node<'a, T, N> {
pub range: AabbPin<&'a mut [T]>,
pub cont: Range<N>,
pub div: Option<N>,
pub min_elem: usize,
}Expand description
The node of a broccoli tree.
Fields§
§range: AabbPin<&'a mut [T]>May or may not be sorted.
cont: Range<N>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<N>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
min_elem: usizeThe 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, N> Freeze for Node<'a, T, N>where
N: Freeze,
impl<'a, T, N> RefUnwindSafe for Node<'a, T, N>where
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, N> Send for Node<'a, T, N>
impl<'a, T, N> Sync for Node<'a, T, N>
impl<'a, T, N> Unpin for Node<'a, T, N>where
N: Unpin,
impl<'a, T, N> !UnwindSafe for Node<'a, T, N>
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