Struct rand_distr::Dirichlet
source · pub struct Dirichlet<F>{ /* private fields */ }
Expand description
The Dirichlet distribution Dirichlet(alpha)
.
The Dirichlet distribution is a family of continuous multivariate probability distributions parameterized by a vector alpha of positive reals. It is a multivariate generalization of the beta distribution.
§Example
use rand::prelude::*;
use rand_distr::Dirichlet;
let dirichlet = Dirichlet::new(&[1.0, 2.0, 3.0]).unwrap();
let samples = dirichlet.sample(&mut rand::thread_rng());
println!("{:?} is from a Dirichlet([1.0, 2.0, 3.0]) distribution", samples);
Implementations§
Trait Implementations§
source§impl<F> Clone for Dirichlet<F>where
F: Float + Clone,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Clone for Dirichlet<F>where
F: Float + Clone,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
source§impl<F> Debug for Dirichlet<F>where
F: Float + Debug,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
impl<F> Debug for Dirichlet<F>where
F: Float + Debug,
StandardNormal: Distribution<F>,
Exp1: Distribution<F>,
Open01: Distribution<F>,
source§impl<F> Distribution<Vec<F>> for Dirichlet<F>
impl<F> Distribution<Vec<F>> for Dirichlet<F>
Auto Trait Implementations§
impl<F> Freeze for Dirichlet<F>
impl<F> RefUnwindSafe for Dirichlet<F>where
F: RefUnwindSafe,
impl<F> Send for Dirichlet<F>where
F: Send,
impl<F> Sync for Dirichlet<F>where
F: Sync,
impl<F> Unpin for Dirichlet<F>
impl<F> UnwindSafe for Dirichlet<F>where
F: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)