/* Appellation: utils Contrib: FL03 Description: ... summary ... */ /// [ordered_sets] is a function for creating subsets of a given [Vec] and set size pub fn ordered_sets(args: Vec, size: usize) -> Vec> { let mut res = Vec::>::new(); for i in 0..args.len() { let tmp = (1..size) .map(|z: usize| (i + z) % size) .collect::>(); for j in 0..tmp.len() { let mut subset = vec![args[i].clone()]; subset.append( &mut (0..tmp.len()) .map(|k: usize| args[tmp[(j + k) % tmp.len()]].clone()) .collect(), ); res.push(subset.clone()); } } res }