Trait space::Knn[][src]

pub trait Knn<P, Ix = usize> where
    P: MetricPoint,
    Ix: Copy
{ type KnnIter: IntoIterator<Item = Neighbor<P::Metric, Ix>>; fn knn(&self, query: &P, num: usize) -> Self::KnnIter; fn nn(&self, query: &P) -> Option<Neighbor<P::Metric, Ix>> { ... } }
Expand description

Implement this trait on data structures (or wrappers) which perform KNN searches.

Associated Types

Required methods

Get num nearest neighbors of target.

For many KNN search algorithms, the returned neighbors are approximate, and may not be the actual nearest neighbors.

Provided methods

Get the nearest neighbor of target.

For many KNN search algorithms, the returned neighbors are approximate, and may not be the actual nearest neighbors.

Implementors