Node

Struct Node 

Source
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: 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§

Source§

impl<'a, T, N: Num> Node<'a, T, N>

Source

pub fn borrow_range(&mut self) -> AabbPin<&mut [T]>

Source

pub fn as_data(&self) -> NodeData<N>

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>

§

impl<'a, T, N> Send for Node<'a, T, N>
where N: Send, T: Send,

§

impl<'a, T, N> Sync for Node<'a, T, N>
where N: Sync, T: Sync,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.