Struct abd_clam::UniBall

source ·
pub struct UniBall<U: Number> { /* private fields */ }
Expand description

A UniBall is a cluster that behaves as clusters used to before the introduction of the Cluster trait.

A UniBall has a center and a radius, and (optionally) has two children.

Trait Implementations§

source§

impl<U: Number> Cluster<U> for UniBall<U>

source§

fn new_root<I: Instance, D: Dataset<I, U>>(data: &D, seed: Option<u64>) -> Self

Creates a new Cluster from a given dataset.
source§

fn partition<I: Instance, D: Dataset<I, U>, P: PartitionCriterion<U>>( self, data: &mut D, criteria: &P, seed: Option<u64> ) -> Self

Recursively partitions the Cluster until the PartitionCriteria are met.
source§

fn offset(&self) -> usize

The offset of the indices of the Cluster’s instances in the dataset.
source§

fn cardinality(&self) -> usize

The number of points in the cluster.
source§

fn depth(&self) -> usize

The depth of the cluster in the tree.
source§

fn arg_center(&self) -> usize

The index of the instance at the center of the Cluster. Read more
source§

fn radius(&self) -> U

The radius of the cluster.
source§

fn arg_radial(&self) -> usize

The index of the instance with the maximum distance from the center
source§

fn lfd(&self) -> f64

The local fractal dimension of the å.
source§

fn children(&self) -> Option<[&Self; 2]>

The two child clusters.
source§

fn polar_distance(&self) -> Option<U>

The distance between the two poles of the Cluster used for partitioning.
source§

fn arg_poles(&self) -> Option<[usize; 2]>

The indices of the instances used as poles for partitioning.
source§

fn name(&self) -> String

The name of the Cluster String. Read more
source§

fn descend_to(&self, offset: usize, cardinality: usize) -> Option<&Self>

Descends to the Cluster with the given offset and cardinality. Read more
source§

fn is_ancestor_of(&self, other: &Self) -> bool

Whether the Cluster is an ancestor of another Cluster.
source§

fn is_descendant_of(&self, other: &Self) -> bool

Whether the Cluster is a descendant of another Cluster.
source§

fn is_leaf(&self) -> bool

Whether the Cluster is a leaf node in the tree.
source§

fn is_singleton(&self) -> bool

Whether the Cluster is a singleton, i.e. it contains only one instance or has a radius of zero.
source§

fn indices(&self) -> Range<usize>

The indices of the instances in the Cluster after the dataset has been reordered.
source§

fn subtree(&self) -> Vec<&Self>

The subtree of the Cluster.
source§

fn max_leaf_depth(&self) -> usize

The maximum depth of and leaf in the subtree of the Cluster. Read more
source§

fn distance_to_instance<I: Instance, D: Dataset<I, U>>( &self, data: &D, instance: &I ) -> U

Distance from the center to the given instance.
source§

fn distance_to_other<I: Instance, D: Dataset<I, U>>( &self, data: &D, other: &Self ) -> U

Distance from the center of this Cluster to the center of the other Cluster.
source§

fn overlapping_children<I: Instance, D: Dataset<I, U>>( &self, data: &D, query: &I, radius: U ) -> Vec<&Self>

Assuming the Cluster overlaps with the query ball, we return only those children that also overlap with the query ball.
source§

fn save(&self, path: &Path) -> Result<(), String>

Saves a Cluster to a given location. Read more
source§

fn load(path: &Path) -> Result<Self, String>

Loads a Cluster from a given location. Read more
source§

impl<U: Debug + Number> Debug for UniBall<U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, U: Number> Deserialize<'de> for UniBall<U>

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl<U: Number> Display for UniBall<U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<U: Number> Hash for UniBall<U>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<U: Number> Ord for UniBall<U>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<U: Number> PartialEq for UniBall<U>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<U: Number> PartialOrd for UniBall<U>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<U: Number> Serialize for UniBall<U>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<U: Number> Eq for UniBall<U>

Auto Trait Implementations§

§

impl<U> RefUnwindSafe for UniBall<U>
where U: RefUnwindSafe,

§

impl<U> Send for UniBall<U>

§

impl<U> Sync for UniBall<U>

§

impl<U> Unpin for UniBall<U>
where U: Unpin,

§

impl<U> UnwindSafe for UniBall<U>
where U: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,