[−][src]Enum rv::data::DataOrSuffStat
Holds either a sufficient statistic of a vector of data.
Variants
Data(&'a Vec<X>)
A Vec
of raw data
SuffStat(&'a Fx::Stat)
A sufficient statistic
None
No data
Methods
impl<'a, X, Fx> DataOrSuffStat<'a, X, Fx> where
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
[src]
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
pub fn n(&self) -> usize
[src]
Get the number of observations
pub fn is_data(&self) -> bool
[src]
Determine whether the object contains data
Example
use rv::dist::Gaussian; use rv::data::GaussianSuffStat; let xs = vec![1.0_f64]; let data: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::Data(&xs); assert!(data.is_data()); let gauss_stats = GaussianSuffStat::new(); let suffstat: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::SuffStat(&gauss_stats); assert!(!suffstat.is_data());
pub fn is_suffstat(&self) -> bool
[src]
Determine whether the object contains sufficient statistics
Example
use rv::dist::Gaussian; use rv::data::GaussianSuffStat; let xs = vec![1.0_f64]; let data: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::Data(&xs); assert!(!data.is_suffstat()); let gauss_stats = GaussianSuffStat::new(); let suffstat: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::SuffStat(&gauss_stats); assert!(suffstat.is_suffstat());
pub fn is_none(&self) -> bool
[src]
Determine whether the object is empty
Example
use rv::dist::Gaussian; use rv::data::GaussianSuffStat; let xs = vec![1.0_f64]; let data: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::Data(&xs); assert!(!data.is_none()); let gauss_stats = GaussianSuffStat::new(); let suffstat: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::SuffStat(&gauss_stats); assert!(!suffstat.is_none()); let none: DataOrSuffStat<f64, Gaussian> = DataOrSuffStat::None; assert!(none.is_none());
Trait Implementations
impl<'a, X: PartialOrd, Fx: PartialOrd> PartialOrd<DataOrSuffStat<'a, X, Fx>> for DataOrSuffStat<'a, X, Fx> where
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: PartialOrd,
[src]
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: PartialOrd,
fn partial_cmp(&self, other: &DataOrSuffStat<'a, X, Fx>) -> Option<Ordering>
[src]
fn lt(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
fn le(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
fn gt(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
fn ge(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
impl<'a, X: PartialEq, Fx: PartialEq> PartialEq<DataOrSuffStat<'a, X, Fx>> for DataOrSuffStat<'a, X, Fx> where
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: PartialEq,
[src]
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: PartialEq,
fn eq(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
fn ne(&self, other: &DataOrSuffStat<'a, X, Fx>) -> bool
[src]
impl<'a, X: Clone, Fx: Clone> Clone for DataOrSuffStat<'a, X, Fx> where
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: Clone,
[src]
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: Clone,
fn clone(&self) -> DataOrSuffStat<'a, X, Fx>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, X: Debug, Fx: Debug> Debug for DataOrSuffStat<'a, X, Fx> where
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: Debug,
[src]
X: 'a + ApiReady,
Fx: 'a + HasSuffStat<X> + ApiReady,
Fx::Stat: ApiReady,
Fx::Stat: Debug,
Auto Trait Implementations
impl<'a, X, Fx> Send for DataOrSuffStat<'a, X, Fx> where
X: Sync,
<Fx as HasSuffStat<X>>::Stat: Sync,
X: Sync,
<Fx as HasSuffStat<X>>::Stat: Sync,
impl<'a, X, Fx> Sync for DataOrSuffStat<'a, X, Fx> where
X: Sync,
<Fx as HasSuffStat<X>>::Stat: Sync,
X: Sync,
<Fx as HasSuffStat<X>>::Stat: Sync,
Blanket Implementations
impl<T> ApiReady for T where
T: Clone + Debug + PartialOrd<T> + PartialEq<T>,
[src]
T: Clone + Debug + PartialOrd<T> + PartialEq<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,