You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/11/03 12:39:50 UTC

[commons-numbers] branch master updated: Add additional stirlingS2 test cases

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 2ff71a05 Add additional stirlingS2 test cases
2ff71a05 is described below

commit 2ff71a0512ed7dbfe461bb5b11fdb1c9f37b93cb
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Nov 3 12:39:09 2022 +0000

    Add additional stirlingS2 test cases
---
 .../commons/numbers/combinatorics/StirlingTest.java | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/commons-numbers-combinatorics/src/test/java/org/apache/commons/numbers/combinatorics/StirlingTest.java b/commons-numbers-combinatorics/src/test/java/org/apache/commons/numbers/combinatorics/StirlingTest.java
index 0264d200..5d797db8 100644
--- a/commons-numbers-combinatorics/src/test/java/org/apache/commons/numbers/combinatorics/StirlingTest.java
+++ b/commons-numbers-combinatorics/src/test/java/org/apache/commons/numbers/combinatorics/StirlingTest.java
@@ -77,8 +77,27 @@ class StirlingTest {
         "10, 6, 22827",
         "10, 7, 5880",
         "10, 8, 750",
+        // n >= 26 is not cached
         "30, 2, 536870911",
-        // Limits for k in [n-1, n]
+        "37, 3, 75047248929022825",
+        "31, 4, 192050639071964750",
+        "29, 5, 1540200411172850701",
+        "26, 6, 224595186974125331",
+        // ... k in [7, 13] require n < 26
+        "26, 14, 477898618396288260",
+        "26, 15, 90449030191104000",
+        "26, 16, 12725877242482560",
+        "27, 17, 35569317763922670",
+        "27, 18, 3270191625210510",
+        "28, 19, 7626292886912700",
+        "28, 20, 474194413703010",
+        // k in [n-6, n-2]
+        "56, 50, 8735311973699025",
+        "115, 110, 79593419077014150",
+        "204, 200, 7075992116527915",
+        "1003, 1000, 20979521187625000",
+        "10002, 10000, 1250416704167500",
+        // Limits for k in [n-1, n] use n = Integer.MAX_VALUE
         "2147483647, 2147483646, 2305843005992468481",
         "2147483647, 2147483647, 1",
     })