[][src]Macro markovian::raw_dist

macro_rules! raw_dist {
    ( $( $x:expr ),* ) => { ... };
}

Creates a Raw struct by first allocating a Vec and passing it to Raw::new.

If you need to pass an iterator, use Raw::new method.

Examples

With help of the raw_dist macro, we construct a random variable that samples always a fixed value.

let value = 0;
let dis: Raw<_> = raw_dist![(1.0, value)];

assert_eq!(value, dis.sample(&mut thread_rng()));
}