pub fn knn<M: Metric>(
        &self,
        dist_to_center: Option<f32>,
        point: &[f32],
        point_cloud: &PointCloud<M>,
        query_heap: &mut KnnQueryHeap,
    ) -> MalwareBrotResult<()> {
        self.singleton_knn(point, point_cloud, query_heap)?;

        let dist_to_center =
            dist_to_center.unwrap_or(point_cloud.distances_to_point(point, &[self.address.1])?[0]);
        self.child_knn(Some(dist_to_center), point, point_cloud, query_heap)?;

        if self.children.is_none() {
            query_heap.push_outliers(&[self.address.1], &[dist_to_center]);
        }
        Ok(())
    }
/// Performs the `singleton_knn` and `child_knn` with a provided query heap. If you have the distance
/// from the query point to this you can pass it to save a distance calculation.
Performs the `singleton_knn` and `child_knn` with a provided query heap. If you have the distance
from the query point to this you can pass it to save a distance calculation.
Performs the ` singleton_knn ` and ` child_knn ` with a provided query heap . If you have the distance from the query point to this you can pass it to save a distance calculation .
pub fn knn<M: Metric>(
        &self,
        dist_to_center: Option<f32>,
        point: &[f32],
        point_cloud: &PointCloud<M>,
        query_heap: &mut KnnQueryHeap,
    ) -> MalwareBrotResult<()> {
        self.singleton_knn(point, point_cloud, query_heap)?;
        let dist_to_center =
            dist_to_center.unwrap_or(point_cloud.distances_to_point(point, &[self.address.1])?[0]);
        self.child_knn(Some(dist_to_center), point, point_cloud, query_heap)?;
        if self.children.is_none() {
            query_heap.push_outliers(&[self.address.1], &[dist_to_center]);
        }
        Ok(())
    }
pub fn knn < M : Metric > ( & self , dist_to_center : Option < f32 > , point : & [ f32 ] , point_cloud : & PointCloud < M > , query_heap : & mut KnnQueryHeap , ) -> MalwareBrotResult < ( ) > { self . singleton_knn ( point , point_cloud , query_heap ) ? ; let dist_to_center = dist_to_center . unwrap_or ( point_cloud . distances_to_point ( point , & [ self . address . 1 ] ) ? [ 0 ] ) ; self . child_knn ( Some ( dist_to_center ) , point , point_cloud , query_heap ) ? ; if self . children . is_none ( ) { query_heap . push_outliers ( & [ self . address . 1 ] , & [ dist_to_center ] ) ; } Ok ( ( ) ) }
Performs the `singleton_knn` and `child_knn` with a provided query heap.
Performs the ` singleton_knn ` and ` child_knn ` with a provided query heap .
&self
dist_to_center
Option<f32>
point
&[f32]
point_cloud
&PointCloud<M>
query_heap
&mut KnnQueryHeap
&self
dist_to_center
Option<f32>
point
&[f32]
point_cloud
&PointCloud<M>
query_heap
&mut KnnQueryHeap