Struct probability::distribution::Bernoulli
source · [−]pub struct Bernoulli { /* private fields */ }
Expand description
A Bernoulli distribution.
Implementations
sourceimpl Bernoulli
impl Bernoulli
sourcepub fn new(p: f64) -> Self
pub fn new(p: f64) -> Self
Create a Bernoulli distribution with success probability p
.
It should hold that p > 0
and p < 1
.
sourcepub fn with_failure(q: f64) -> Self
pub fn with_failure(q: f64) -> Self
Create a Bernoulli distribution with failure probability q
.
It should hold that q > 0
and q < 1
. This constructor is preferable
when q
is very small.
Trait Implementations
sourceimpl Distribution for Bernoulli
impl Distribution for Bernoulli
impl Copy for Bernoulli
Auto Trait Implementations
impl RefUnwindSafe for Bernoulli
impl Send for Bernoulli
impl Sync for Bernoulli
impl Unpin for Bernoulli
impl UnwindSafe for Bernoulli
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more