Struct goko::node::CoverNode [−][src]
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> CoverNode<D>
[src]
impl<D: PointCloud> CoverNode<D>
[src]pub fn new(
parent_address: Option<NodeAddress>,
address: NodeAddress
) -> CoverNode<D>
[src]
parent_address: Option<NodeAddress>,
address: NodeAddress
) -> CoverNode<D>
Creates a new blank node
pub fn label_summary(&self) -> Option<Arc<SummaryCounter<D::LabelSummary>>>
[src]
If the node has a summary attached, this returns the summary.
pub fn metasummary(&self) -> Option<Arc<SummaryCounter<D::MetaSummary>>>
[src]
If the node has a summary attached, this returns the summary.
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]
&self,
transform_fn: F
) -> Option<S> where
F: FnOnce(&T) -> S,
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<P: Deref<Target = D::Point> + Send + Sync, T: SingletonQueryHeap + RoutingQueryHeap>(
&self,
dist_to_center: Option<f32>,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
dist_to_center: Option<f32>,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
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<P: Deref<Target = D::Point> + Send + Sync, T: SingletonQueryHeap>(
&self,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
Performs a brute force knn against just the singleton children with a provided query heap.
pub fn child_knn<P: Deref<Target = D::Point> + Send + Sync, T: RoutingQueryHeap>(
&self,
dist_to_center: Option<f32>,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
dist_to_center: Option<f32>,
point: &P,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
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<P: Deref<Target = D::Point> + Send + Sync>(
&self,
scale_base: f32,
dist_to_center: f32,
point: &P,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
[src]
&self,
scale_base: f32,
dist_to_center: f32,
point: &P,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
Gives the closest routing node to the query point.
pub fn first_covering_child<P: Deref<Target = D::Point> + Send + Sync>(
&self,
scale_base: f32,
dist_to_center: f32,
point: &P,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
[src]
&self,
scale_base: f32,
dist_to_center: f32,
point: &P,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
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.
Trait Implementations
impl<D: PointCloud> Clone for CoverNode<D>
[src]
impl<D: PointCloud> Clone for CoverNode<D>
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<D> !RefUnwindSafe for CoverNode<D>
impl<D> !RefUnwindSafe for CoverNode<D>
impl<D> !UnwindSafe for CoverNode<D>
impl<D> !UnwindSafe for CoverNode<D>
Blanket Implementations
impl<T, U> Cast<U> for T where
U: FromCast<T>,
impl<T, U> Cast<U> for T where
U: FromCast<T>,
pub fn cast(self) -> U
impl<T> FromCast<T> for T
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
impl<T> Same<T> for T
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<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub unsafe fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,