MCPcopy Create free account
hub / github.com/ElementsProject/elements / Combination

Function Combination

src/minisketch/src/test.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace {
19
20uint64_t Combination(uint64_t n, uint64_t k) {
21 if (n - k < k) k = n - k;
22 uint64_t ret = 1;
23 for (uint64_t i = 1; i <= k; ++i) {
24 ret = (ret * n) / i;
25 --n;
26 }
27 return ret;
28}
29
30/** Create a vector with Minisketch objects, one for each implementation. */
31std::vector<Minisketch> CreateSketches(uint32_t bits, size_t capacity) {

Callers 1

TestExhaustiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected