Trait SimpleSample

Source
pub trait SimpleSample {
    // Required method
    fn randomize(&mut self);

    // Provided methods
    fn simple_sample<F>(&mut self, times: usize, f: F)
       where F: FnMut(&Self) { ... }
    fn simple_sample_vec<F, G>(&mut self, times: usize, f: F) -> Vec<G>
       where F: FnMut(&Self) -> G { ... }
}
Expand description

For easy sampling of your ensemble

Required Methods§

Source

fn randomize(&mut self)

§Randomizes self according to model

Provided Methods§

Source

fn simple_sample<F>(&mut self, times: usize, f: F)
where F: FnMut(&Self),

§do the following times times:
  1. f(self)
  2. self.randomize()
Source

fn simple_sample_vec<F, G>(&mut self, times: usize, f: F) -> Vec<G>
where F: FnMut(&Self) -> G,

§do the following times times:
  1. res = f(self)
  2. self.randomize()
§res is collected into Vector

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§