Macro prophet::samples [] [src]

macro_rules! samples {
    [ $( [ $($i:expr),+ ] => [ $($e:expr),+ ] ),+ ] => { ... };
    [ $( [ $($i:expr),+ ] => $e:expr ),+ ] => { ... };
    [ $( $i:expr => [ $($e:expr),+ ] ),+ ] => { ... };
    [ $( $i:expr => $e:expr ),+ ] => { ... };
}

Creates a vector of samples.

Given the following definitions

let t =  1.0;
let f = -1.0;

... this macro invokation ...

let samples = samples![
    [f, f] => f,
    [t, f] => t,
    [f, t] => t,
    [t, t] => f
];

... will expand to this

let samples = vec![
    Sample::new(vec![f, f], vec![f]),
    Sample::new(vec![t, f], vec![t]),
    Sample::new(vec![f, t], vec![t]),
    Sample::new(vec![t, t], vec![f]),
];