[][src]Struct goko::node::CoverNode

pub struct CoverNode<D: PointCloud> { /* fields omitted */ }

The actual cover node. The fields can be separated into three piles. The first two consist of node address for testing and reference when working and the radius, coverage_count, and singles_summary for a query various properties of the node. Finally we have the children and singleton pile. The singletons are saved in a SmallVec directly attached to the node. This saves a memory redirect for the first 20 singleton children. The children are saved in a separate struct also consisting of a SmallVec (though, this is only 10 wide before we allocate on the heap), and the scale index of the nested child.

Implementations

impl<D: PointCloud + LabeledCloud> CoverNode<D>[src]

pub fn label_summary(&self) -> Option<Arc<SummaryCounter<D::LabelSummary>>>[src]

If the node has a summary attached, this returns the summary.

impl<D: PointCloud + MetaCloud> CoverNode<D>[src]

pub fn metasummary(&self) -> Option<Arc<SummaryCounter<D::MetaSummary>>>[src]

If the node has a summary attached, this returns the summary.

impl<D: PointCloud> CoverNode<D>[src]

pub fn new(
    parent_address: Option<NodeAddress>,
    address: NodeAddress
) -> CoverNode<D>
[src]

Creates a new blank node

pub fn is_leaf(&self) -> bool[src]

Verifies that this is a leaf by checking there's no nested child

pub fn radius(&self) -> f32[src]

This is currently inconsistent on inserts to children of this node

pub fn coverage_count(&self) -> usize[src]

Number of decendents of this node

pub fn get_plugin_and<T: Send + Sync + 'static, F, S>(
    &self,
    transform_fn: F
) -> Option<S> where
    F: FnOnce(&T) -> S, 
[src]

Reads the contents of a plugin, due to the nature of the plugin map we have to access it with a closure.

pub fn singletons_len(&self) -> usize[src]

The number of singleton points attached to the node

pub fn singletons(&self) -> &[usize][src]

pub fn address(&self) -> NodeAddress[src]

pub fn parent_address(&self) -> Option<NodeAddress>[src]

pub fn center_index(&self) -> &usize[src]

pub fn scale_index(&self) -> &i32[src]

pub fn children_len(&self) -> usize[src]

pub fn children(&self) -> Option<(i32, &[NodeAddress])>[src]

If the node is not a leaf this unpacks the child struct to a more publicly consumable format.

pub fn knn<'a, T: SingletonQueryHeap + RoutingQueryHeap>(
    &self,
    dist_to_center: Option<f32>,
    point: &D::PointRef,
    point_cloud: &D,
    query_heap: &mut T
) -> GokoResult<()>
[src]

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 singleton_knn<'a, T: SingletonQueryHeap>(
    &self,
    point: &D::PointRef,
    point_cloud: &D,
    query_heap: &mut T
) -> GokoResult<()>
[src]

Performs a brute force knn against just the singleton children with a provided query heap.

pub fn child_knn<'a, T: RoutingQueryHeap>(
    &self,
    dist_to_center: Option<f32>,
    point: &D::PointRef,
    point_cloud: &D,
    query_heap: &mut T
) -> GokoResult<()>
[src]

Performs a brute force knn against the children of the node with a provided query heap. Does nothing if this is a leaf node. If you have the distance from the query point to this you can pass it to save a distance calculation.

pub fn nearest_covering_child<'a>(
    &self,
    scale_base: f32,
    dist_to_center: f32,
    point: &D::PointRef,
    point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
[src]

Gives the closest routing node to the query point.

pub fn first_covering_child<'a>(
    &self,
    scale_base: f32,
    dist_to_center: f32,
    point: &D::PointRef,
    point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
[src]

Gives the child that the point would be inserted into if the point just happened to never be picked as a center. This is the first child node that covers the point.

pub fn insert_nested_child(
    &mut self,
    scale_index: i32,
    coverage: usize
) -> GokoResult<()>
[src]

Add a nested child and converts the node from a leaf to a routing node. Throws an error if the node is already a routing node with a nested node.

Trait Implementations

impl<D: PointCloud> Clone for CoverNode<D>[src]

impl<D: Debug + PointCloud> Debug for CoverNode<D>[src]

Auto Trait Implementations

impl<D> !RefUnwindSafe for CoverNode<D>[src]

impl<D> Send for CoverNode<D>[src]

impl<D> Sync for CoverNode<D>[src]

impl<D> Unpin for CoverNode<D> where
    D: Unpin
[src]

impl<D> !UnwindSafe for CoverNode<D>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,