Struct acap::vp::FlatVpTree [−][src]
pub struct FlatVpTree<T: Proximity> { /* fields omitted */ }
Expand description
A vantage-point tree stored as a flat array.
A FlatVpTree is always balanced and usually more efficient than a VpTree, but doesn’t support dynamic updates.
Implementations
Create a balanced tree out of a sequence of items.
Trait Implementations
Creates a value from an iterator. Read more
impl<K, V> NearestNeighbors<K, V> for FlatVpTree<V> where
K: Proximity<V, Distance = V::Distance>,
V: Proximity,
impl<K, V> NearestNeighbors<K, V> for FlatVpTree<V> where
K: Proximity<V, Distance = V::Distance>,
V: Proximity,
fn search<'k, 'v, N>(&'v self, neighborhood: N) -> N where
K: 'k,
V: 'v,
N: Neighborhood<&'k K, &'v V>,
fn search<'k, 'v, N>(&'v self, neighborhood: N) -> N where
K: 'k,
V: 'v,
N: Neighborhood<&'k K, &'v V>,
Search for nearest neighbors and add them to a neighborhood.
Returns the nearest neighbor to target
(or None
if this index is empty).
Returns the nearest neighbor to target
within the distance threshold
, if one exists.
Returns the up to k
nearest neighbors to target
. Read more
Returns the up to k
nearest neighbors to target
within the distance threshold
. Read more
Merges up to k
nearest neighbors into an existing sorted vector.