Struct bktree::BkTree [−][src]
pub struct BkTree<T> { /* fields omitted */ }
Expand description
A BK-tree datastructure
Implementations
impl<T> BkTree<T>
[src]
impl<T> BkTree<T>
[src]pub fn new(dist: impl Fn(&T, &T) -> isize + 'static) -> Self
[src]
pub fn new(dist: impl Fn(&T, &T) -> isize + 'static) -> Self
[src]Create a new BK-tree with a given distance function
pub fn insert_all<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]
pub fn insert_all<I: IntoIterator<Item = T>>(&mut self, iter: I)
[src]Insert every element from a given iterator in the BK-tree
pub fn find(&self, val: T, max_dist: isize) -> Vec<(&T, isize)>
[src]
pub fn find(&self, val: T, max_dist: isize) -> Vec<(&T, isize)>
[src]Find the closest elements to a given value present in the BK-tree
Returns pairs of element references and distances