pub struct TDigest { /* private fields */ }Expand description
T-Digest to be operated on.
Implementations§
Source§impl TDigest
impl TDigest
pub fn new_with_size(max_size: usize) -> Self
pub fn new( centroids: Vec<Centroid>, sum: f64, count: f64, max: f64, min: f64, max_size: usize, ) -> Self
pub fn mean(&self) -> f64
pub fn sum(&self) -> f64
pub fn count(&self) -> f64
pub fn max(&self) -> f64
pub fn min(&self) -> f64
pub fn is_empty(&self) -> bool
pub fn max_size(&self) -> usize
Source§impl TDigest
impl TDigest
pub fn merge_unsorted(&self, unsorted_values: Vec<f64>) -> TDigest
pub fn merge_sorted(&self, sorted_values: Vec<f64>) -> TDigest
pub fn merge_digests(digests: Vec<TDigest>) -> TDigest
Sourcepub fn estimate_quantile(&self, q: f64) -> f64
pub fn estimate_quantile(&self, q: f64) -> f64
To estimate the value located at q quantile
Trait Implementations§
Source§impl Archive for TDigest
impl Archive for TDigest
Source§type Archived = ArchivedTDigest
type Archived = ArchivedTDigest
The archived representation of this type. Read more
Source§type Resolver = TDigestResolver
type Resolver = TDigestResolver
The resolver for this type. It must contain all the additional information from serializing
needed to make the archived type from the normal type.
Source§impl<__D: Fallible + ?Sized> Deserialize<TDigest, __D> for Archived<TDigest>where
Vec<Centroid>: Archive,
Archived<Vec<Centroid>>: Deserialize<Vec<Centroid>, __D>,
usize: Archive,
Archived<usize>: Deserialize<usize, __D>,
OrderedFloat<f64>: Archive,
Archived<OrderedFloat<f64>>: Deserialize<OrderedFloat<f64>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<TDigest, __D> for Archived<TDigest>where
Vec<Centroid>: Archive,
Archived<Vec<Centroid>>: Deserialize<Vec<Centroid>, __D>,
usize: Archive,
Archived<usize>: Deserialize<usize, __D>,
OrderedFloat<f64>: Archive,
Archived<OrderedFloat<f64>>: Deserialize<OrderedFloat<f64>, __D>,
impl Eq for TDigest
impl StructuralPartialEq for TDigest
Auto Trait Implementations§
impl Freeze for TDigest
impl RefUnwindSafe for TDigest
impl Send for TDigest
impl Sync for TDigest
impl Unpin for TDigest
impl UnwindSafe for TDigest
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more