[][src]Function libra_proptest_helpers::pick_idxs

pub fn pick_idxs<T: ?Sized, P>(
    max: usize,
    indexes: &T,
    indexes_len: usize
) -> Vec<usize> where
    T: OpsIndex<usize, Output = P>,
    P: AsRef<PropIndex>, 

Given a maximum value max and a list of Index instances, picks integers in the range [0, max) uniformly randomly and without duplication.

If indexes_len is greater than max, all indexes will be returned.

This function implements Robert Floyd's F2 algorithm for sampling without replacement.