ae.utils.math.combinatorics

ae.utils.math.combinatorics

Members

Functions

binomialCoefficient
R binomialCoefficient(T n, T k)

https://en.wikipedia.org/wiki/Binomial_coefficient

This implementation is non-recursive but overflows easily

multisetCoefficient
R multisetCoefficient(T n, T k)

https://en.wikipedia.org/wiki/Multiset#Counting_multisets

Structs

BinomialCoefficientTable
struct BinomialCoefficientTable(T, T maxN, T maxK)

Precalculated binomial coefficient table

CNS
struct CNS(P, U, size_t N, U unpackedCard, bool lexicographic, bool multiset, alias binomialCalculator = ae.utils.math.combinatorics)

Combinatorial number system encoder/decoder https://en.wikipedia.org/wiki/Combinatorial_number_system

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>