pub enum Given<Ix: ColumnIndex> {
Conditions(Vec<(Ix, Datum)>),
Nothing,
}
Expand description
Describes a the conditions (or not) on a conditional distribution
Variants§
Conditions(Vec<(Ix, Datum)>)
The conditions in (column_id, value)
tuples. The tuple
(11, Datum::Continuous(2.3))
indicates that we wish to condition on
the value of column 11 being 2.3.
Nothing
The absence of conditioning observations
Implementations§
source§impl<Ix: ColumnIndex> Given<Ix>
impl<Ix: ColumnIndex> Given<Ix>
sourcepub fn is_nothing(&self) -> bool
pub fn is_nothing(&self) -> bool
Determine whether there are no conditions
§Example
let nothing_given = Given::<usize>::Nothing;
assert!(nothing_given.is_nothing());
let something_given = Given::Conditions(
vec![(1, Datum::Categorical(1_u8.into()))]
);
assert!(!something_given.is_nothing());
sourcepub fn is_conditions(&self) -> bool
pub fn is_conditions(&self) -> bool
Determine whether there are conditions
§Example
let nothing_given = Given::<usize>::Nothing;
assert!(!nothing_given.is_conditions());
let something_given = Given::Conditions(
vec![(1, Datum::Categorical(1_u8.into()))]
);
assert!(something_given.is_conditions());
Trait Implementations§
source§impl<Ix: ColumnIndex> Default for Given<Ix>
impl<Ix: ColumnIndex> Default for Given<Ix>
source§impl<'de, Ix> Deserialize<'de> for Given<Ix>where
Ix: Deserialize<'de> + ColumnIndex,
impl<'de, Ix> Deserialize<'de> for Given<Ix>where
Ix: Deserialize<'de> + ColumnIndex,
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<Ix: PartialEq + ColumnIndex> PartialEq for Given<Ix>
impl<Ix: PartialEq + ColumnIndex> PartialEq for Given<Ix>
source§impl<Ix: PartialOrd + ColumnIndex> PartialOrd for Given<Ix>
impl<Ix: PartialOrd + ColumnIndex> PartialOrd for Given<Ix>
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 moreimpl<Ix: ColumnIndex> StructuralPartialEq for Given<Ix>
Auto Trait Implementations§
impl<Ix> RefUnwindSafe for Given<Ix>where
Ix: RefUnwindSafe,
impl<Ix> Send for Given<Ix>where
Ix: Send,
impl<Ix> Sync for Given<Ix>where
Ix: Sync,
impl<Ix> Unpin for Given<Ix>where
Ix: Unpin,
impl<Ix> UnwindSafe for Given<Ix>where
Ix: 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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.