Struct acap::kd::KdTree [−][src]
pub struct KdTree<T> { /* fields omitted */ }
Expand description
A k-d tree.
Implementations
Create a balanced tree out of a sequence of items.
Iterate over the items stored in this tree.
Push a new item into the tree.
Inserting elements individually tends to unbalance the tree. Use KdTree::balanced()
if
possible to create a balanced tree from a batch of items.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
impl<K, V> NearestNeighbors<K, V> for KdTree<V> where
K: KdProximity<V>,
K::Value: PartialOrd<K::Distance>,
V: Coordinates,
impl<K, V> NearestNeighbors<K, V> for KdTree<V> where
K: KdProximity<V>,
K::Value: PartialOrd<K::Distance>,
V: Coordinates,
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.
impl<K, V> ExactNeighbors<K, V> for KdTree<V> where
K: KdProximity<V> + Minkowski<V>,
K::Value: PartialOrd<K::Distance>,
V: Coordinates,
k-d trees are exact for Minkowski distances.