Function random_partition

Source
pub fn random_partition<R: MutRandState>(
    rng: &mut R,
    total: usize,
    number_of_parts: usize,
) -> Vec<usize>
Expand description

Generates a random partition of total into number_of_parts.

§Returns

A vector containing a random partition with elements ordered in descending order.

§Arguments

  • rng - the random number generator used
  • total - the number being partitioned
  • number_of_parts - how many pieces the partition should have