Function random_partitions

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

Generates multiple random partitions of total into number_of_parts.

§Returns

A 2D array where each row represents a 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
  • number_of_partitions - the total number of partitions to generate