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) -> O
pub fn standard_deviation<O>(&self) -> O
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<T, W> FillWith<W> for WeightedSum<T>
impl<T, W> FillWith<W> for WeightedSum<T>
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 for WeightedSum<T>
impl<T: PartialEq> PartialEq for WeightedSum<T>
Source§impl<T: PartialOrd> PartialOrd for WeightedSum<T>
impl<T: PartialOrd> PartialOrd for WeightedSum<T>
impl<T: Copy> Copy for WeightedSum<T>
impl<T: Eq> Eq for WeightedSum<T>
impl<T> StructuralPartialEq for WeightedSum<T>
Auto Trait Implementations§
impl<T> Freeze for WeightedSum<T>where
T: Freeze,
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