[−][src]Struct goko::node::CoverNode
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]
parent_address: Option<NodeAddress>,
address: NodeAddress
) -> CoverNode<D>
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]
&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<'a, T: SingletonQueryHeap + RoutingQueryHeap>(
&self,
dist_to_center: Option<f32>,
point: &D::PointRef,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
dist_to_center: Option<f32>,
point: &D::PointRef,
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<'a, T: SingletonQueryHeap>(
&self,
point: &D::PointRef,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
point: &D::PointRef,
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<'a, T: RoutingQueryHeap>(
&self,
dist_to_center: Option<f32>,
point: &D::PointRef,
point_cloud: &D,
query_heap: &mut T
) -> GokoResult<()>
[src]
&self,
dist_to_center: Option<f32>,
point: &D::PointRef,
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<'a>(
&self,
scale_base: f32,
dist_to_center: f32,
point: &D::PointRef,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
[src]
&self,
scale_base: f32,
dist_to_center: f32,
point: &D::PointRef,
point_cloud: &D
) -> GokoResult<Option<(f32, NodeAddress)>>
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]
&self,
scale_base: f32,
dist_to_center: f32,
point: &D::PointRef,
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.
pub fn insert_nested_child(
&mut self,
scale_index: i32,
coverage: usize
) -> GokoResult<()>
[src]
&mut self,
scale_index: i32,
coverage: usize
) -> GokoResult<()>
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]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
D: Unpin,
impl<D> !UnwindSafe for CoverNode<D>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
pub fn cast(self) -> U
impl<T> From<T> for T
[src]
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
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<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,