use cereal_lib;
const LOOP_NUMBERS: [i32; 5] = [1, 10, 100, 1_000, 10_000];
fn stats_wrapper(vec: Vec<i32>) {
let (mean, median, max, min) = cereal_lib::statistics(vec);
println!(
"Mean: {}, Median: {}, Max: {}, Min: {}\n",
mean, median, max, min
)
}
#[test]
fn run_multi() {
println!("Multi-threaded:");
for number_of_loops in LOOP_NUMBERS.iter() {
println!("Number of Simulations:{}", number_of_loops);
let data = cereal_lib::simulation(*number_of_loops, 8);
stats_wrapper(data)
}
}
#[test]
fn run_single() {
println!("Multi-threaded:");
for number_of_loops in LOOP_NUMBERS.iter() {
println!("Number of Simulations:{}", number_of_loops);
let data = cereal_lib::simulation_single_thread(*number_of_loops);
stats_wrapper(data)
}
}