pub struct KdTree<A, T: PartialEq, U: AsRef<[A]> + PartialEq> { /* private fields */ }
Implementations§
Source§impl<A: Float + Zero + One, T: PartialEq, U: AsRef<[A]> + PartialEq> KdTree<A, T, U>
impl<A: Float + Zero + One, T: PartialEq, U: AsRef<[A]> + PartialEq> KdTree<A, T, U>
Sourcepub fn new(dims: usize) -> Self
pub fn new(dims: usize) -> Self
Create a new KD tree, specifying the dimension size of each point
Sourcepub fn with_capacity(dimensions: usize, capacity: usize) -> Self
pub fn with_capacity(dimensions: usize, capacity: usize) -> Self
Create a new KD tree, specifying the dimension size of each point and the capacity of leaf nodes
pub fn size(&self) -> usize
pub fn nearest<F>( &self, point: &[A], num: usize, distance: &F, ) -> Result<Vec<(A, &T)>, ErrorKind>
pub fn within<F>( &self, point: &[A], radius: A, distance: &F, ) -> Result<Vec<(A, &T)>, ErrorKind>
pub fn iter_nearest<'a, 'b, F>( &'b self, point: &'a [A], distance: &'a F, ) -> Result<NearestIter<'a, 'b, A, T, U, F>, ErrorKind>
pub fn iter_nearest_mut<'a, 'b, F>( &'b mut self, point: &'a [A], distance: &'a F, ) -> Result<NearestIterMut<'a, 'b, A, T, U, F>, ErrorKind>
pub fn add(&mut self, point: U, data: T) -> Result<(), ErrorKind>
pub fn remove(&mut self, point: &U, data: &T) -> Result<usize, ErrorKind>
Trait Implementations§
Auto Trait Implementations§
impl<A, T, U> Freeze for KdTree<A, T, U>where
A: Freeze,
impl<A, T, U> RefUnwindSafe for KdTree<A, T, U>
impl<A, T, U> Send for KdTree<A, T, U>
impl<A, T, U> Sync for KdTree<A, T, U>
impl<A, T, U> Unpin for KdTree<A, T, U>
impl<A, T, U> UnwindSafe for KdTree<A, T, U>
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