etl/docs/maths/comb-perm.md
2026-04-15 13:02:52 +02:00

902 B

title
Combinations / Permutations

Templates to provide combinations and permutations constants.

Combinations

See Combinations

template <size_t N, size_t K>
struct combinations

Member const
Number of combinations of K items from a total of N.

static ETL_CONSTEXPR size_t value

If C++17 is supported.

template <size_t N, size_t K>
inline constexpr size_t combinations_v = combinations<N, K>::value;

Permutations

See Permutations

template <size_t N, size_t K>
struct permutations

Member const
Number of permutations of K items from a total of N.

static ETL_CONSTEXPR size_t value

If C++17 is supported.

template <size_t N, size_t K>
inline constexpr size_t permutations_v = permutations<N, K>::value;