EcGen 1.1.8
Loading...
Searching...
No Matches
combin.hpp File Reference

Combination generation using the revolving door algorithm. More...

#include <py2cpp/gen.hpp>
#include <py2cpp/recursive_gen.hpp>
#include <type_traits>
#include <utility>
Include dependency graph for combin.hpp:

Go to the source code of this file.

Namespaces

namespace  ecgen

Functions

auto ecgen::emk_comb_gen (int n, int k) -> py::RecursiveGenerator< std::pair< int, int > >
 Generate all k-combinations of n elements (revolving door algorithm).
template<typename Container>
auto ecgen::emk (int n, int k, Container lst) -> py::Generator< Container & >
 Generate all k-combinations in reverse lexicographic order (revolving door).
template<int N, int K>
constexpr auto ecgen::Combination ()
 Calculate binomial coefficient C(N, K) at compile time.

Detailed Description

Combination generation using the revolving door algorithm.