Type Alias Orthtree

Source
pub type Orthtree<const X: usize, const D: usize, S, Data> = Tree<Node<SizedOrthant<X, D, NodeID, S>>, Data>;
Expand description

N-dimensional generalisation of quadtrees/octrees.

Aliased Type§

pub struct Orthtree<const X: usize, const D: usize, S, Data> {
    pub nodes: Vec<Node<SizedOrthant<X, D, u32, S>>>,
    pub data: Vec<Data>,
}

Fields§

§nodes: Vec<Node<SizedOrthant<X, D, u32, S>>>

Vector of Node objects that define the structure of the tree.

§data: Vec<Data>

Vector of generic Data objects that contain information about the associated Node.

The data vector is parallel to the nodes vector, so the i-th element of the data vector corresponds to the i-th element of the nodes vector.

Implementations§

Source§

impl<const X: usize, const D: usize, S, Data> Orthtree<X, D, S, Data>

Source

pub fn build_node<I, P, C>( &mut self, input: &[I], position: P, compute: C, ) -> Option<NodeID>
where I: Copy, P: Fn(I) -> [S; D] + Copy, C: Fn(&[I]) -> Data + Copy, S: Copy + Float + PartialOrd, BoundingBox<[S; D]>: SubDivide<Division = [BoundingBox<[S; D]>; X]>,

Recursively inserts new Nodes in the current Orthtree from the given input and functions until the computed square bounding box stops subdividing.

Source

pub fn build_node_with<I, P, C>( &mut self, bbox: BoundingBox<[S; D]>, input: &[I], pos: P, compute: C, ) -> Option<NodeID>
where I: Copy, P: Fn(I) -> [S; D] + Copy, C: Fn(&[I]) -> Data + Copy, S: Copy + Float + PartialOrd, BoundingBox<[S; D]>: SubDivide<Division = [BoundingBox<[S; D]>; X]>,

Recursively inserts new Nodes in the current Orthtree from the given input and functions until the given bounding box stops subdividing.