Struct stats::OnlineStats
source · pub struct OnlineStats { /* private fields */ }
Expand description
Online state for computing mean, variance and standard deviation.
Implementations§
source§impl OnlineStats
impl OnlineStats
sourcepub fn new() -> OnlineStats
pub fn new() -> OnlineStats
Create initial state.
Population size, variance and mean are set to 0
.
sourcepub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats
pub fn from_slice<T: ToPrimitive>(samples: &[T]) -> OnlineStats
Initializes variance from a sample.
sourcepub fn add<T: ToPrimitive>(&mut self, sample: &T)
pub fn add<T: ToPrimitive>(&mut self, sample: &T)
Add a new sample.
Trait Implementations§
source§impl Clone for OnlineStats
impl Clone for OnlineStats
source§fn clone(&self) -> OnlineStats
fn clone(&self) -> OnlineStats
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Commute for OnlineStats
impl Commute for OnlineStats
source§impl Debug for OnlineStats
impl Debug for OnlineStats
source§impl Default for OnlineStats
impl Default for OnlineStats
source§fn default() -> OnlineStats
fn default() -> OnlineStats
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for OnlineStats
impl<'de> Deserialize<'de> for OnlineStats
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: ToPrimitive> Extend<T> for OnlineStats
impl<T: ToPrimitive> Extend<T> for OnlineStats
source§fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, it: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T: ToPrimitive> FromIterator<T> for OnlineStats
impl<T: ToPrimitive> FromIterator<T> for OnlineStats
source§fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats
fn from_iter<I: IntoIterator<Item = T>>(it: I) -> OnlineStats
Creates a value from an iterator. Read more
source§impl PartialEq for OnlineStats
impl PartialEq for OnlineStats
source§fn eq(&self, other: &OnlineStats) -> bool
fn eq(&self, other: &OnlineStats) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for OnlineStats
impl Serialize for OnlineStats
impl Copy for OnlineStats
impl StructuralPartialEq for OnlineStats
Auto Trait Implementations§
impl Freeze for OnlineStats
impl RefUnwindSafe for OnlineStats
impl Send for OnlineStats
impl Sync for OnlineStats
impl Unpin for OnlineStats
impl UnwindSafe for OnlineStats
Blanket Implementations§
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more