Dataset for a combination k out of n.
More...
#include <combinations.h>
|
| Combination (const std::array< T, k > &combi, const std::array< T, n - k > &comp) |
|
T | in (unsigned int i) const |
| The i th element which is part of the combination in descending order. More...
|
|
T | out (unsigned int i) const |
| The i th element which is not part of the combination in descending order. More...
|
|
Combination< n, n - k, T > | complement () const |
| Return the complement of this combination. More...
|
|
template<int kk = k> |
constexpr std::enable_if<(kk > 0), Combination< n, k - 1, T > >::type | eliminate (unsigned int i) const |
| The combination obtained by eliminating the i th element. More...
|
|
template<int kk = k> |
constexpr std::enable_if<(kk< n), Combination< n, k+1, T > >::type | add (unsigned int i) const |
| The combination obtained by adding the element i . More...
|
|
template<int kk = k> |
constexpr std::enable_if<(kk<=n), Combination< n+1, k+1, T > >::type | add_and_expand (unsigned int i) const |
| The combination out of n+1 obtained by adding one element. More...
|
|
void | print_debug (std::ostream &os) const |
| Print the content of this object for debugging. More...
|
|
|
std::array< T, k > | data |
| The array of members. More...
|
|
std::array< T, n - k > | cdata |
| The array of non-members. More...
|
|
template<int n, int k, typename T = unsigned int>
class TPCC::Combination< n, k, T >
Dataset for a combination k out of n.
◆ Combination()
template<int n, int k, typename T = unsigned int>
◆ add()
template<int n, int k, typename T = unsigned int>
template<int kk = k>
The combination obtained by adding the element i
.
- Note
- The return value type declaration with
std::enable_if
eliminates this function for k==n
, since you cannot choose more than n
items out of n
.
◆ add_and_expand()
template<int n, int k, typename T = unsigned int>
template<int kk = k>
constexpr std::enable_if<(kk <= n), Combination<n + 1, k + 1, T> >::type TPCC::Combination< n, k, T >::add_and_expand |
( |
unsigned int |
i | ) |
const |
|
inlineconstexpr |
The combination out of n+1
obtained by adding one element.
◆ complement()
template<int n, int k, typename T = unsigned int>
Return the complement of this combination.
◆ eliminate()
template<int n, int k, typename T = unsigned int>
template<int kk = k>
The combination obtained by eliminating the i
th element.
- Note
- The return value type declaration with
std::enable_if
eliminates this function for k==0
, since you cannot remove an item from an empty set.
◆ in()
template<int n, int k, typename T = unsigned int>
The i
th element which is part of the combination in descending order.
◆ out()
template<int n, int k, typename T = unsigned int>
The i
th element which is not part of the combination in descending order.
◆ print_debug()
template<int n, int k, typename T = unsigned int>
Print the content of this object for debugging.
◆ cdata
template<int n, int k, typename T = unsigned int>
The array of non-members.
◆ data
template<int n, int k, typename T = unsigned int>
The documentation for this class was generated from the following file:
- /home/runner/work/HyperHDG/HyperHDG/submodules/tensor_product_chain_complex.git/include/tpcc/combinations.h