[go: up one dir, main page]

large_combination

Function large_combination 

Source
pub fn large_combination<'a, T, F>(domain: &'a [T], r: usize, cb: F)
where T: 'a, for<'r> F: FnMut(&'r [&'a T]) + 'a,
Expand description

Generate a r-combination from given domain and call callback function on each combination.

§Parameter

  1. domain : &[T] - A slice contain a domain to generate r-combination
  2. r : usize - A size of combination
  3. cb : FnMut(&[&T]) - A callback that return each combination

§Panic

It panic when r > domain.len()