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

Permutation generation (SJT and EHR algorithms). More...

#include <py2cpp/gen.hpp>
#include <type_traits>
Include dependency graph for perm.hpp:

Go to the source code of this file.

Namespaces

namespace  ecgen

Functions

auto ecgen::sjt_gen (int n) -> py::Generator< int >
 Generate permutation indices using Steinhaus-Johnson-Trotter algorithm.
auto ecgen::ehr_gen (int n) -> py::Generator< int >
 Generate permutation indices using Eades-Hickey-Read (EHR) algorithm.
template<int N>
constexpr auto ecgen::Factorial ()
 Compute factorial N! at compile time.
template<typename Container>
auto ecgen::sjt (Container &perm) -> py::Generator< Container & >
 Generate all permutations via adjacent transpositions (SJT algorithm).

Detailed Description

Permutation generation (SJT and EHR algorithms).