This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch feature_NUMBERS-215
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git


The following commit(s) were added to refs/heads/feature_NUMBERS-215 by this 
push:
     new 3653046a NUMBERS-215: Iterates over k-partitions.
3653046a is described below

commit 3653046a206a6b3eb856c2047cf69821cfd88f07
Author: Gilles Sadowski <[email protected]>
AuthorDate: Sun Sep 20 10:46:55 2026 +0200

    NUMBERS-215: Iterates over k-partitions.
    
    Javadoc fix.
---
 .../commons/numbers/combinatorics/Stirling.java    | 35 ++++++++++------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git 
a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Stirling.java
 
b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Stirling.java
index faaa62c9..33391544 100644
--- 
a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Stirling.java
+++ 
b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Stirling.java
@@ -388,25 +388,6 @@ public final class Stirling {
             return stirlingS2;
         }
 
-        /**
-         * Iteration wrapped in a stream.
-         * This method must be kept "internal" to ensure consistency: Argument
-         * {@code gen} must be a {@link PartitionGenerator} instance tied to
-         * {@code this} instance.
-         *
-         * @param gen Partition generator.
-         * @return a stream (without duplicate or "null" elements).
-         *
-         * @param <T> Partition representation.
-         */
-        private <T> Stream<T> streamInternal(Iterable<T> gen) {
-            final int characteristics = Spliterator.DISTINCT | 
Spliterator.NONNULL;
-            return 
StreamSupport.stream(Spliterators.spliterator(gen.iterator(),
-                                                                 stirlingS2,
-                                                                 
characteristics),
-                                        false);
-        }
-
         /**
          * Iteration wrapped in a stream, where each element is a partition,
          * into {@code k} subsets of a set of {@code n} elements.
@@ -466,6 +447,22 @@ public final class Stirling {
         //     };
         // }
 
+        /**
+         * Converts {@link Iterable} to {@link Stream}.
+         *
+         * @param gen Partition generator.
+         * @return a stream (without duplicate or "null" elements).
+         *
+         * @param <T> Partition representation.
+         */
+        private <T> Stream<T> streamInternal(Iterable<T> gen) {
+            final int characteristics = Spliterator.DISTINCT | 
Spliterator.NONNULL;
+            return 
StreamSupport.stream(Spliterators.spliterator(gen.iterator(),
+                                                                 stirlingS2,
+                                                                 
characteristics),
+                                        false);
+        }
+
         /**
          * Maps a given partition to a user-defined list of objects.
          *

Reply via email to