dlib.math.combinatorics

Combinatorics

Members

Aliases

C
alias C = combinations

Common vernacular for combinations

P
alias P = permutations
Undocumented in source.
choose
alias choose = combinations

Common vernacular for combinations

fib
alias fib = fibonacci

Common vernacular for fibonacci

Functions

combinations
ulong combinations(ulong objects, ulong taken)

Compute the number of combinations of objects types of items when considered taken at a time, where order is ignored

doubleFactorial
ulong doubleFactorial(ulong n)

Computes the double factorial of n: n * (n - 2) * (n - 4) * ... * 1

factorial
ulong factorial(ulong n)

Returns the factorial of n

fibonacci
ulong fibonacci(ulong n)

Computes the nth fibonacci number

hyperFactorial
BigInt hyperFactorial(ulong n)

Computes the hyperfactorial of n: 1^1 * 2^2 * 3^3 * ... n^n

lucas
ulong lucas(ulong n)

Computes the nth Lucas number

permutations
ulong permutations(ulong objects, ulong taken)

Compute the number of permutations of objects types of items when considered taken at a time, where order is considered

Meta

Authors

Nick Papanastasiou, Timur Gafarov