pub struct KdTree<A, const K: usize> { /* private fields */ }
Implementations§
Source§impl<A: Float + Zero + One, const K: usize> KdTree<A, K>
impl<A: Float + Zero + One, const K: usize> KdTree<A, K>
pub fn new() -> Self
pub fn with_per_node_capacity(capacity: usize) -> Result<Self, ErrorKind>
pub fn size(&self) -> usize
pub fn is_leaf(&self) -> bool
pub fn best_n_within<F>( &self, point: &[A; K], radius: A, max_qty: usize, distance: &F, ) -> Result<Vec<&[A; K]>, ErrorKind>
Sourcepub fn add(&mut self, point: &[A; K]) -> Result<(), ErrorKind>
pub fn add(&mut self, point: &[A; K]) -> Result<(), ErrorKind>
Add an element to the tree. The first argument specifies the location in kd space at which the element is located. The second argument is the data associated with that point in space.
§Examples
use kiddo::KdTree;
let mut tree: KdTree<f64, 3> = KdTree::new();
tree.add(&[1.0, 2.0, 5.0])?;
tree.add(&[1.1, 2.1, 5.1])?;
assert_eq!(tree.size(), 2);
Trait Implementations§
Auto Trait Implementations§
impl<A, const K: usize> Freeze for KdTree<A, K>where
A: Freeze,
impl<A, const K: usize> RefUnwindSafe for KdTree<A, K>where
A: RefUnwindSafe,
impl<A, const K: usize> Send for KdTree<A, K>where
A: Send,
impl<A, const K: usize> Sync for KdTree<A, K>where
A: Sync,
impl<A, const K: usize> Unpin for KdTree<A, K>where
A: Unpin,
impl<A, const K: usize> UnwindSafe for KdTree<A, K>where
A: UnwindSafe,
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