[
https://issues.apache.org/jira/browse/NUMBERS-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117062#comment-18117062
]
Alex Herbert commented on NUMBERS-215:
--------------------------------------
Actually this method cannot be static without having to specify k first which
is a change from the other Stirling methods which all use (n, k):
{code:java}
public static <T> Stream<List<List<T>>> stream(int k, T... items) {
{code}
Perhaps we should drop it from the API as it is simple to call
Arrays.asList(T... items) and use the List factory method.
> Stirling partitions generator
> -----------------------------
>
> Key: NUMBERS-215
> URL: https://issues.apache.org/jira/browse/NUMBERS-215
> Project: Commons Numbers
> Issue Type: New Feature
> Components: combinatorics
> Reporter: Gilles Sadowski
> Assignee: Gilles Sadowski
> Priority: Minor
> Fix For: 1.4
>
>
> Would it be useful to provide functionality to *iterate* over the partitions
> defined by "Stirling number of the second kind" (i.e. all partitions into K
> subsets, of a set of N elements)?
> Code would be in a nested static class of the existing
> [{{Stirling}}|https://commons.apache.org/proper/commons-numbers/commons-numbers-combinatorics/apidocs/src-html/org/apache/commons/numbers/combinatorics/Stirling.html]
> class:
> {code}
> public final class Stirling {
> // ...
> public static final class S2 implements Iterable<List<List<Integer>> {
> // ...
> public static S2 of(int n, int k) {
> // ...
> }
> }
> }
> {code}
> I have a potential use case (for very small "N").
--
This message was sent by Atlassian Jira
(v8.20.10#820010)