pub struct MultinomialDistribution<K: DistributionKey> { /* private fields */ }Implementations§
Source§impl<K: DistributionKey + Copy> MultinomialDistribution<K>
impl<K: DistributionKey + Copy> MultinomialDistribution<K>
pub fn total_weights(&self) -> f32
pub fn uniform_over<I: IntoIterator<Item = K>>(keys: I) -> Self
pub fn normalized_weights(&self) -> HashMap<Arc<K>, f32>
pub fn entropy(&self) -> f32
pub fn joint_probability_weights<BMD: Borrow<Self>>( &self, other: BMD, ) -> HashMap<Arc<K>, f32>
pub fn joint_probability<BMD: Borrow<Self>>( &self, other: BMD, ) -> MultinomialDistribution<K>
Source§impl<K: DistributionKey> MultinomialDistribution<K>
impl<K: DistributionKey> MultinomialDistribution<K>
pub fn sample_with_default_rng(&self) -> K
Trait Implementations§
Source§impl<K: Clone + DistributionKey> Clone for MultinomialDistribution<K>
impl<K: Clone + DistributionKey> Clone for MultinomialDistribution<K>
Source§fn clone(&self) -> MultinomialDistribution<K>
fn clone(&self) -> MultinomialDistribution<K>
Returns a duplicate 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<K: Debug + DistributionKey> Debug for MultinomialDistribution<K>
impl<K: Debug + DistributionKey> Debug for MultinomialDistribution<K>
Source§impl<'de, K> Deserialize<'de> for MultinomialDistribution<K>where
K: Deserialize<'de> + DistributionKey,
impl<'de, K> Deserialize<'de> for MultinomialDistribution<K>where
K: Deserialize<'de> + DistributionKey,
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<K: DistributionKey> Distribution<K> for MultinomialDistribution<K>
impl<K: DistributionKey> Distribution<K> for MultinomialDistribution<K>
Source§impl<K: DistributionKey> From<HashMap<Arc<K>, f32>> for MultinomialDistribution<K>
impl<K: DistributionKey> From<HashMap<Arc<K>, f32>> for MultinomialDistribution<K>
Source§impl<K: DistributionKey> From<HashMap<K, f32>> for MultinomialDistribution<K>
impl<K: DistributionKey> From<HashMap<K, f32>> for MultinomialDistribution<K>
Source§impl<K: DistributionKey> From<MultinomialDistribution<K>> for MapNodeState<K>
impl<K: DistributionKey> From<MultinomialDistribution<K>> for MapNodeState<K>
Source§fn from(value: MultinomialDistribution<K>) -> Self
fn from(value: MultinomialDistribution<K>) -> Self
Converts to this type from the input type.
Source§impl<K> Serialize for MultinomialDistribution<K>where
K: Serialize + DistributionKey,
impl<K> Serialize for MultinomialDistribution<K>where
K: Serialize + DistributionKey,
Auto Trait Implementations§
impl<K> Freeze for MultinomialDistribution<K>
impl<K> RefUnwindSafe for MultinomialDistribution<K>where
K: RefUnwindSafe,
impl<K> Send for MultinomialDistribution<K>
impl<K> Sync for MultinomialDistribution<K>
impl<K> Unpin for MultinomialDistribution<K>
impl<K> UnwindSafe for MultinomialDistribution<K>where
K: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more