use samplics::sampling::{EqualProbability, Population, UnstratifiedSample}; // fn main() { // let y: Vec = vec![10, 20, 30, 40, 50]; // let pop = Population::new(y, None, None); // let samp_size1 = 2; // let mut srs_sample1 = UnstratifiedSample::new(samp_size1, false, None); // assert!(srs_sample1.samp_size == 2); // assert!(srs_sample1.pop_size == None); // assert!(srs_sample1.fpc == 0.0); // assert!(srs_sample1.with_replacement == false); // srs_sample1.select(&pop, Some(7)); // println!("{:?}", srs_sample1.index); // let samp_size2 = 3; // let mut srs_sample2 = UnstratifiedSample::new(samp_size2, true, None); // assert!(srs_sample2.samp_size == 3); // assert!(srs_sample2.pop_size == None); // assert!(srs_sample2.fpc == 0.0); // assert!(srs_sample2.with_replacement == true); // srs_sample2.select(&pop, Some(15)); // println!("{:?}", srs_sample2.index); // } fn main() { for _ in 0..1000 { let y: Vec = (1..1000000).collect(); let pop = Population::new(y, None, None); let mut srs_sample1 = UnstratifiedSample::new(10000, false, None); srs_sample1.select(&pop, None); } }