Skip to content
Snippets Groups Projects
Verified Commit 069b483f authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

branch out the RNG

this is basically what !130 is trying to do.
parent cf36b0c5
No related branches found
No related tags found
No related merge requests found
use clap::Parser;
use rand::{rngs::StdRng, Rng, RngCore, SeedableRng};
fn measure(nb_measurements: usize, rng: &mut impl RngCore) {
fn measure(nb_measurements: usize, rng: &(impl RngCore + 'static)) {
let mut rng: StdRng = (rng as &dyn std::any::Any)
.downcast_ref::<StdRng>()
.unwrap()
.clone();
for _ in 0..nb_measurements {
println!(" {}", rng.gen::<u128>());
}
......@@ -11,7 +16,7 @@ fn run<Fun: Fn(usize) -> bool>(
max_t: usize,
nb_measurements: usize,
measurement_schedule: Fun,
rng: &mut impl RngCore,
rng: &mut (impl RngCore + 'static),
) {
println!("0: {}", rng.gen::<u128>());
for t in 1..=max_t {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment