pub struct CategoricalHash<T: Hash + Eq, P>(/* private fields */);Expand description
A Categorical that performs deduplication using a Hashtable
Trait Implementations§
Source§impl<T, P> Categorical<T, P> for CategoricalHash<T, P>
impl<T, P> Categorical<T, P> for CategoricalHash<T, P>
fn iter<'a>(&'a self) -> impl 'a + Iterator<Item = (&'a T, &'a P)>where
T: 'a,
P: 'a,
fn probabilities_mut<'a>(&'a mut self) -> impl 'a + Iterator<Item = &'a mut P>where
T: 'a,
P: 'a,
Source§fn probability_of(&self, x: &T) -> P
fn probability_of(&self, x: &T) -> P
Returns the probability of some category.
Source§fn new_uniform(it: impl Iterator<Item = T>) -> Self
fn new_uniform(it: impl Iterator<Item = T>) -> Self
Construct a
Categorical with same probability for each category.Source§fn normalize_in_place(&mut self) -> &mut Self
fn normalize_in_place(&mut self) -> &mut Self
Rescale probabilities such that they sum up to 1. Read more
Source§impl<T: Hash + Eq, P: NumAssignRef + NumRef + Clone> FromIterator<(T, P)> for CategoricalHash<T, P>
impl<T: Hash + Eq, P: NumAssignRef + NumRef + Clone> FromIterator<(T, P)> for CategoricalHash<T, P>
Source§impl<T: Hash + Eq, P> IntoIterator for CategoricalHash<T, P>
impl<T: Hash + Eq, P> IntoIterator for CategoricalHash<T, P>
Auto Trait Implementations§
impl<T, P> Freeze for CategoricalHash<T, P>
impl<T, P> RefUnwindSafe for CategoricalHash<T, P>where
T: RefUnwindSafe,
P: RefUnwindSafe,
impl<T, P> Send for CategoricalHash<T, P>
impl<T, P> Sync for CategoricalHash<T, P>
impl<T, P> Unpin for CategoricalHash<T, P>
impl<T, P> UnsafeUnpin for CategoricalHash<T, P>
impl<T, P> UnwindSafe for CategoricalHash<T, P>where
T: UnwindSafe,
P: 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