pub enum SamplingMethod {
Linear,
CumulativeDistributionFunction,
StochasticAcceptance,
}
Expand description
Sampling method to use when, sampling from discrete distribution.
Variants§
Linear
Performs linear scan on probabilities.
Worst case is O(n).
CumulativeDistributionFunction
Performs selection by creating cumulative distribution function (CDF), and performing selection.
Worst case is O(ln n).
StochasticAcceptance
Performs selection using stochastic acceptance. Average case is O(1), but may require at most N call to random number generator function.
Worst case is O(n). Average case is O(1).
Reference: https://arxiv.org/abs/1109.3627
Trait Implementations§
Source§impl Clone for SamplingMethod
impl Clone for SamplingMethod
Source§fn clone(&self) -> SamplingMethod
fn clone(&self) -> SamplingMethod
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 Debug for SamplingMethod
impl Debug for SamplingMethod
impl Copy for SamplingMethod
Auto Trait Implementations§
impl Freeze for SamplingMethod
impl RefUnwindSafe for SamplingMethod
impl Send for SamplingMethod
impl Sync for SamplingMethod
impl Unpin for SamplingMethod
impl UnwindSafe for SamplingMethod
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