Function rusty_machine::learning::toolkit::rand_utils::in_place_fisher_yates
source · [−]pub fn in_place_fisher_yates<T>(arr: &mut [T])
Expand description
The in place Fisher-Yates shuffle.
Examples
use rusty_machine::learning::toolkit::rand_utils;
// Collect the numbers 0..5
let mut a = (0..5).collect::<Vec<_>>();
// Permute the values in place with Fisher-Yates
rand_utils::in_place_fisher_yates(&mut a);