Package org.hipparchus.util
Class RosenNumberPartitionIterator
java.lang.Object
org.hipparchus.util.RosenNumberPartitionIterator
- All Implemented Interfaces:
Iterator<int[]>
An iterator that generates all partitions of
n
elements, into k
parts
containing the number of elements in each part, based on Rosen's algorithm.
This is a copy of the class (with slight edits) with the same name from the Symja Library. The original file was published under the terms of the GPLV3 license, but the Hipparchus project was explicitly allowed to include it relicensed to Apache V2.
See Kenneth H. Rosen, Discrete Mathematics and Its Applications, 2nd edition (NY: McGraw-Hill, 1991), pp. 284-286
-
Constructor Details
-
RosenNumberPartitionIterator
public RosenNumberPartitionIterator(int n, int k) Simple constructor.- Parameters:
n
- the number of elementsk
- divided into k parts
-
-
Method Details