pub struct DensityMultiSub<S, D>where
D: Density<S>,{ /* private fields */ }Trait Implementations§
Source§impl<S, D> Density<S> for DensityMultiSub<S, D>where
D: Density<S>,
impl<S, D> Density<S> for DensityMultiSub<S, D>where
D: Density<S>,
Source§fn probability(&mut self, s: &S, c: &[S]) -> f64
fn probability(&mut self, s: &S, c: &[S]) -> f64
Defines the probability of each instance
s of S. This probability can be dependend on
the previously chosen instances of S and are passed with c.Source§fn chain<F: FnMut(f64) -> f64 + 'static>(self, func: F) -> DensityChain<S, Self>where
Self: Sized,
fn chain<F: FnMut(f64) -> f64 + 'static>(self, func: F) -> DensityChain<S, Self>where
Self: Sized,
Applies the given function
func to each probability computed by Density::probability.Source§fn transform<F: FnMut(S) -> S + 'static>(
self,
func: F,
) -> DensityTransformer<S, Self>
fn transform<F: FnMut(S) -> S + 'static>( self, func: F, ) -> DensityTransformer<S, Self>
Each time
DensityTransformer::probability is called, the given function func is
applied to the input and the previously chosen instances of S.Source§fn add<DD: Density<S>>(self, density: DD) -> DensityAdd<S, Self, DD>where
Self: Sized,
fn add<DD: Density<S>>(self, density: DD) -> DensityAdd<S, Self, DD>where
Self: Sized,
Add
Densitys.
Every value of the first and second densities are added together.Source§fn sub<DD: Density<S>>(self, density: DD) -> DensitySub<S, Self, DD>where
Self: Sized,
fn sub<DD: Density<S>>(self, density: DD) -> DensitySub<S, Self, DD>where
Self: Sized,
Subtract
Densitys.
Every value of the second density is subtracted from the value of the first density.Source§fn mul<DD: Density<S>>(self, density: DD) -> DensityMul<S, Self, DD>where
Self: Sized,
fn mul<DD: Density<S>>(self, density: DD) -> DensityMul<S, Self, DD>where
Self: Sized,
Multiplies
Densitys.
Every value of the first density is multiplied with the value of the second density.Source§fn div<DD: Density<S>>(self, density: DD) -> DensityDiv<S, Self, DD>where
Self: Sized,
fn div<DD: Density<S>>(self, density: DD) -> DensityDiv<S, Self, DD>where
Self: Sized,
Divides
Densitys.
Every value of the first density is divided by the value of the second density.Auto Trait Implementations§
impl<S, D> Freeze for DensityMultiSub<S, D>
impl<S, D> RefUnwindSafe for DensityMultiSub<S, D>where
S: RefUnwindSafe,
D: RefUnwindSafe,
impl<S, D> Send for DensityMultiSub<S, D>
impl<S, D> Sync for DensityMultiSub<S, D>
impl<S, D> Unpin for DensityMultiSub<S, D>
impl<S, D> UnsafeUnpin for DensityMultiSub<S, D>
impl<S, D> UnwindSafe for DensityMultiSub<S, D>where
S: UnwindSafe,
D: 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> 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