KDTreeOptimized

Trait KDTreeOptimized 

Source
pub trait KDTreeOptimized<T: Float + Send + Sync + 'static, D> {
    // Required methods
    fn directed_hausdorff_distance(
        &self,
        points: &ArrayView2<'_, T>,
        seed: Option<u64>,
    ) -> SpatialResult<(T, usize, usize)>;
    fn hausdorff_distance(
        &self,
        points: &ArrayView2<'_, T>,
        seed: Option<u64>,
    ) -> SpatialResult<T>;
    fn batch_nearest_neighbor(
        &self,
        points: &ArrayView2<'_, T>,
    ) -> SpatialResult<(Array1<usize>, Array1<T>)>;
}
Expand description

Extension trait to add optimized operations to the KDTree

Required Methods§

Source

fn directed_hausdorff_distance( &self, points: &ArrayView2<'_, T>, seed: Option<u64>, ) -> SpatialResult<(T, usize, usize)>

Compute the directed Hausdorff distance from one point set to another using KD-tree acceleration

This method is significantly faster than the standard directed_hausdorff function for large point sets.

§Arguments
  • points - The points to compute distance to
  • seed - Optional seed for random shuffling
§Returns
  • A tuple containing the directed Hausdorff distance, and indices of the points realizing this distance
Source

fn hausdorff_distance( &self, points: &ArrayView2<'_, T>, seed: Option<u64>, ) -> SpatialResult<T>

Compute the Hausdorff distance between two point sets using KD-tree acceleration

§Arguments
  • points - The points to compute distance to
  • seed - Optional seed for random shuffling
§Returns
  • The Hausdorff distance between the two point sets
Source

fn batch_nearest_neighbor( &self, points: &ArrayView2<'_, T>, ) -> SpatialResult<(Array1<usize>, Array1<T>)>

Compute the approximate nearest neighbor for each point in a set

§Arguments
  • points - The points to find nearest neighbors for
§Returns
  • A tuple of arrays containing indices and distances of the nearest neighbors

Implementors§

Source§

impl<T: Float + Send + Sync + 'static, D: Distance<T> + 'static> KDTreeOptimized<T, D> for KDTree<T, D>