Struct linfa_nn::KdTree [−][src]
pub struct KdTree;
Expand description
Implementation of K-D tree, a fast space-partitioning data structure. For each parent node,
the indexed points are split with a hyperplane into two child nodes. Due to its tree-like
structure, the K-D tree performs spatial queries in O(k * logN)
time, where k
is the number
of points returned by the query. Calling from_batch
returns a KdTree
.
More details can be found here.
Unlike other NearestNeighbour
implementations, KdTree
requires that points be laid out
contiguously in memory and will panic otherwise.
Implementations
Trait Implementations
fn from_batch_with_leaf_size<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
leaf_size: usize,
dist_fn: D
) -> Result<Box<dyn NearestNeighbourIndex<F> + 'a>, BuildError>
fn from_batch_with_leaf_size<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
leaf_size: usize,
dist_fn: D
) -> Result<Box<dyn NearestNeighbourIndex<F> + 'a>, BuildError>
Builds a spatial index using a MxN two-dimensional array representing M points with N
dimensions. Also takes leaf_size
, which specifies the number of elements in the leaf
nodes of tree-like index structures. Read more
fn from_batch<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
dist_fn: D
) -> Result<Box<dyn NearestNeighbourIndex<F> + 'a>, BuildError>
fn from_batch<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
dist_fn: D
) -> Result<Box<dyn NearestNeighbourIndex<F> + 'a>, BuildError>
Builds a spatial index using a default leaf size. See from_batch_with_leaf_size
for more
information. Read more
Auto Trait Implementations
impl RefUnwindSafe for KdTree
impl UnwindSafe for KdTree
Blanket Implementations
Mutably borrows from an owned value. Read more