IntegerPartitioner2D

Provides a tree-based approach to obtain the different integer partitions possible when n balls are divided into different numbers of boxes

partition_data: dict

 

@classmethod
get_partitions(cls, boxes, balls): 

LLM Docstring

Enumerate all ways to distribute balls into boxes (a 2-D integer partition / contingency-table enumeration), sorting both descending and undoing the sort on the result.

  • boxes: np.ndarray

    the box capacities

  • balls: np.ndarray

    the ball counts

  • :returns: np.ndarray

    the enumerated distributions


Feedback

Examples

Templates

Documentation