Struct ndhistogram::value::WeightedSum
source · pub struct WeightedSum<T = f64> { /* private fields */ }
Expand description
ndhistogram bin value type that calculates a weight sum.
It also provides methods to keep track of the sum of weights squared.
This is used to provide estimates of the statistical error on the weighted
sum. This performs a similar function to Sumw2
that
ROOT users may be familiar
with.
Implementations§
source§impl<T: Copy> WeightedSum<T>
impl<T: Copy> WeightedSum<T>
sourcepub fn new() -> Selfwhere
Self: Default,
pub fn new() -> Selfwhere Self: Default,
Factory method to create an unfilled (or zero-valued) WeightedSum.
sourcepub fn variance(&self) -> T
pub fn variance(&self) -> T
Estimate of the variance of the weighted sum value is the sum of the weights squared.
sourcepub fn standard_deviation<O>(&self) -> Owhere
T: Into<O>,
O: Float,
pub fn standard_deviation<O>(&self) -> Owhere T: Into<O>, O: Float,
Square root of the variance.
Trait Implementations§
source§impl<T: Clone> Clone for WeightedSum<T>
impl<T: Clone> Clone for WeightedSum<T>
source§fn clone(&self) -> WeightedSum<T>
fn clone(&self) -> WeightedSum<T>
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<T: Debug> Debug for WeightedSum<T>
impl<T: Debug> Debug for WeightedSum<T>
source§impl<T: Default> Default for WeightedSum<T>
impl<T: Default> Default for WeightedSum<T>
source§fn default() -> WeightedSum<T>
fn default() -> WeightedSum<T>
Returns the “default value” for a type. Read more
source§impl<'de, T> Deserialize<'de> for WeightedSum<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for WeightedSum<T>where T: Deserialize<'de>,
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, W> FillWith<W> for WeightedSum<T>where
T: FillWith<W> + Copy,
W: Mul<Output = W> + Copy,
impl<T, W> FillWith<W> for WeightedSum<T>where T: FillWith<W> + Copy, W: Mul<Output = W> + Copy,
source§impl<T: Hash> Hash for WeightedSum<T>
impl<T: Hash> Hash for WeightedSum<T>
source§impl<T: Ord> Ord for WeightedSum<T>
impl<T: Ord> Ord for WeightedSum<T>
source§fn cmp(&self, other: &WeightedSum<T>) -> Ordering
fn cmp(&self, other: &WeightedSum<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq<WeightedSum<T>> for WeightedSum<T>
impl<T: PartialEq> PartialEq<WeightedSum<T>> for WeightedSum<T>
source§fn eq(&self, other: &WeightedSum<T>) -> bool
fn eq(&self, other: &WeightedSum<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd<WeightedSum<T>> for WeightedSum<T>
impl<T: PartialOrd> PartialOrd<WeightedSum<T>> for WeightedSum<T>
source§fn partial_cmp(&self, other: &WeightedSum<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &WeightedSum<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl<T> Serialize for WeightedSum<T>where
T: Serialize,
impl<T> Serialize for WeightedSum<T>where T: Serialize,
impl<T: Copy> Copy for WeightedSum<T>
impl<T: Eq> Eq for WeightedSum<T>
impl<T> StructuralEq for WeightedSum<T>
impl<T> StructuralPartialEq for WeightedSum<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for WeightedSum<T>where T: RefUnwindSafe,
impl<T> Send for WeightedSum<T>where T: Send,
impl<T> Sync for WeightedSum<T>where T: Sync,
impl<T> Unpin for WeightedSum<T>where T: Unpin,
impl<T> UnwindSafe for WeightedSum<T>where T: UnwindSafe,
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