[][src]Struct petal_neighbors::BallTree

pub struct BallTree<'a, M: Metric> { /* fields omitted */ }

A data structure for neighbor search in a multi-dimensional space.

Methods

impl<'a, M: Metric> BallTree<'a, M>[src]

pub fn with_metric(points: ArrayView2<'a, f64>, metric: M) -> Self[src]

Builds a ball tree containing the given points.

Panics

Panics if points is empty.

pub fn query_one<'p, P>(&self, point: P) -> Neighbor where
    P: 'p + Copy + IntoIterator,
    <P as IntoIterator>::Item: Copy + Into<&'p f64>, 
[src]

Finds the nearest neighbor and its distance in the tree.

Panics

Panics if the tree is empty.

pub fn query<'p, P>(&self, point: P, k: usize) -> Vec<Neighbor> where
    P: 'p + Copy + IntoIterator,
    <P as IntoIterator>::Item: Copy + Into<&'p f64>, 
[src]

pub fn query_radius<'p, P>(&self, point: P, distance: f64) -> Vec<usize> where
    P: 'p + Copy + IntoIterator,
    <P as IntoIterator>::Item: Copy + Into<&'p f64>, 
[src]

Trait Implementations

impl<'a, M: Debug + Metric> Debug for BallTree<'a, M>[src]

Auto Trait Implementations

impl<'a, M> Send for BallTree<'a, M> where
    M: Send

impl<'a, M> Sync for BallTree<'a, M> where
    M: Sync

impl<'a, M> Unpin for BallTree<'a, M> where
    M: Unpin

impl<'a, M> UnwindSafe for BallTree<'a, M> where
    M: UnwindSafe

impl<'a, M> RefUnwindSafe for BallTree<'a, M> where
    M: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for 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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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