HyperHDG
|
#include <combinations.h>
Public Member Functions | |
constexpr Combination< n, k > | operator[] (unsigned int) |
A boolean array of length n with a true for each selected value. More... | |
Static Public Member Functions | |
static constexpr unsigned int | size () |
The number of such combinations. More... | |
static std::array< unsigned int, k > | value (unsigned int index) |
The array of numbers (of length k ) in the combination with given index. More... | |
static std::array< unsigned int, n - k > | dual (unsigned int index) |
The array of numbers (of length n-k ) of numbers not in the combination of the given index. More... | |
template<typename T > | |
static constexpr unsigned int | index (const Combination< n, k, T > &combi) |
The index of a combination within the lexicographic enumeration. More... | |
Static Private Member Functions | |
template<unsigned int size, typename... I> | |
static constexpr std::array< unsigned int, k > | compute_value (unsigned int index, I... args) |
The function template computing the combination in lexicographic ordering recursively. More... | |
The combinations of k
elements out of n
as a container.
This class template does not contain any data, but it implements an enumeration of combinations, such that any combination as an array of k
numbers from 0
to n-1
can be obtained from its index and vice versa.
|
staticconstexprprivate |
The function template computing the combination in lexicographic ordering recursively.
|
static |
|
inlinestaticconstexpr |
The index of a combination within the lexicographic enumeration.
|
constexpr |
A boolean array of length n
with a true
for each selected value.
|
staticconstexpr |
The number of such combinations.
|
static |
The array of numbers (of length k
) in the combination with given index.