Class Stirling
- java.lang.Object
-
- de.tilman_neumann.jml.combinatorics.Stirling
-
public class Stirling extends Object
Computation of Stirling numbers.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description Stirling()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigInteger
absStirling1(int n, int k)
Absolute Stirling numbers of the first kind.static void
main(String[] args)
Tests.static BigInteger[]
nextStirling1Diag(BigInteger[] lastDiag, int n1, int k)
static BigInteger
rStirling1(int n, int k, int r)
Compute r-Stirling numbers of the first kind s(n,k,r)static BigInteger
stirling1(int n, int k)
(Signed) Stirling numbers of the first kind.static BigInteger[]
stirling1Diag(int n, int k)
Calculates the diagonal of Stirling numbers of the first kind S1(n-k+1,1), S1(n-k+2,2), ..., S1(n-1,k-1), S1(n,k).static BigInteger
stirling2(int n, int k)
Stirling numbers of the second kind S(n,k).
-
-
-
Method Detail
-
stirling1
public static BigInteger stirling1(int n, int k)
(Signed) Stirling numbers of the first kind.- Parameters:
n
- Upper parameterk
- Lower parameter- Returns:
- s(n,k)
-
absStirling1
public static BigInteger absStirling1(int n, int k)
Absolute Stirling numbers of the first kind.- Parameters:
n
- Upper parameterk
- Lower parameter- Returns:
- |s(n,k)|
-
stirling2
public static BigInteger stirling2(int n, int k)
Stirling numbers of the second kind S(n,k).- Parameters:
n
-k
-- Returns:
- BigInt
- See Also:
- http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html
-
rStirling1
public static BigInteger rStirling1(int n, int k, int r)
Compute r-Stirling numbers of the first kind s(n,k,r)- Parameters:
n
- Upper parameterk
- Lower parameterr
- r-value- Returns:
- s(n,k,r)
-
stirling1Diag
public static BigInteger[] stirling1Diag(int n, int k)
Calculates the diagonal of Stirling numbers of the first kind S1(n-k+1,1), S1(n-k+2,2), ..., S1(n-1,k-1), S1(n,k).- Parameters:
n
-k
-- Returns:
- an array containing the Stirling numbers of the diagonal
-
nextStirling1Diag
public static BigInteger[] nextStirling1Diag(BigInteger[] lastDiag, int n1, int k)
-
main
public static void main(String[] args)
Tests.- Parameters:
args
- ignored
-
-