Trait net_ensembles::sampling::SimpleSample
source · [−]pub trait SimpleSample {
fn randomize(&mut self);
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, Global>
where
F: FnMut(&Self) -> G,
{ ... }
}
Expand description
For easy sampling of your ensemble
Required Methods
sourcefn randomize(&mut self)
fn randomize(&mut self)
Randomizes self according to model
- this is intended for creation of initial sample
- used in
simple_sample
andsimple_sample_vec
Provided Methods
sourcefn simple_sample<F>(&mut self, times: usize, f: F)where
F: FnMut(&Self),
fn simple_sample<F>(&mut self, times: usize, f: F)where
F: FnMut(&Self),
do the following times
times:
f(self)
self.randomize()