[][src]Struct kdt::KdTree

pub struct KdTree<T: PartialOrd + PartialEq + Clone, const DIM: usize> { /* fields omitted */ }

Implementations

impl<T: PartialOrd + PartialEq + Clone + Debug, const DIM: usize> KdTree<T, DIM>[src]

pub fn dim() -> usize[src]

pub fn from_slice(points: &mut [Point<T, DIM>]) -> Self[src]

pub fn contains(&self, point: &Point<T, DIM>) -> bool[src]

pub fn insert(&mut self, point: Point<T, DIM>) -> bool[src]

Insert a point into the tree.

Inserting elements one by one is likely to cause the tree to become inbalanced. Prefer from_slice to construct the tree.

impl<T: PartialOrd + PartialEq + Clone + Float + Debug, const DIM: usize> KdTree<T, DIM>[src]

pub fn k_nearest_neighbors(
    &self,
    query: &Point<T, DIM>,
    k: usize
) -> Vec<(T, &Point<T, DIM>)>
[src]

Trait Implementations

impl<T: Debug + PartialOrd + PartialEq + Clone, const DIM: usize> Debug for KdTree<T, DIM>[src]

impl<T: Default + PartialOrd + PartialEq + Clone, const DIM: usize> Default for KdTree<T, DIM>[src]

Auto Trait Implementations

impl<T, const DIM: usize> RefUnwindSafe for KdTree<T, DIM> where
    T: RefUnwindSafe
[src]

impl<T, const DIM: usize> Send for KdTree<T, DIM> where
    T: Send
[src]

impl<T, const DIM: usize> Sync for KdTree<T, DIM> where
    T: Sync
[src]

impl<T, const DIM: usize> Unpin for KdTree<T, DIM>[src]

impl<T, const DIM: usize> UnwindSafe for KdTree<T, DIM> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,