[−][src]Trait bintrie::Heuristic
The Heuristic
chooses which side to explore next.
This is not useful for finding perfect nearest neighbors because it can take a path first that eliminates another better match in another branch. This will work well to find things of a particular distance, which is useful for discrete nearest neighbor searches in a given radius. It is also useful to find all things within a given radius, but the outputs will only be approximately ordered with respect to distance.
This is cloned right before entering a side
, so it is expected that
enter
updates the state of the Heuristic
.
Associated Types
Loading content...Required methods
fn enter(&mut self, side: bool)
This is passed the side
.
fn iter(&self) -> Self::Iter
Must return an iterator which returns values below 16
, otherwise panics.
Implementors
impl<F> Heuristic for FilterHeuristic<F> where
F: FnMut(bool) -> bool + Clone,
[src]
F: FnMut(bool) -> bool + Clone,
type Iter = FilterHeuristicIter<F>
fn enter(&mut self, side: bool)
[src]
fn iter(&self) -> Self::Iter
[src]
impl<F> Heuristic for SearchHeuristic<F> where
F: FnMut(bool) -> bool + Clone,
[src]
F: FnMut(bool) -> bool + Clone,