[][src]Trait bintrie::Heuristic

pub trait Heuristic: Clone {
    type Iter: Iterator<Item = bool>;
    fn enter(&mut self, side: bool);
fn iter(&self) -> Self::Iter; }

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

type Iter: Iterator<Item = bool>

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.

Loading content...

Implementors

impl<F> Heuristic for FilterHeuristic<F> where
    F: FnMut(bool) -> bool + Clone
[src]

type Iter = FilterHeuristicIter<F>

impl<F> Heuristic for SearchHeuristic<F> where
    F: FnMut(bool) -> bool + Clone
[src]

type Iter = Cloned<Iter<'static, bool>>

Loading content...