23 #ifndef SYMMETRICCOUNTER_H_INCLUDED 24 #define SYMMETRICCOUNTER_H_INCLUDED 34 IMPLEMENTS_STD_VECTOR(T,
counter);
38 static constexpr
char separator =
'\'';
62 if (size() > 0 and increment(0)) {
69 static size_t combinatorial(
size_t N,
size_t m)
73 for (
size_t i = 1; i <= N; ++i) {
86 auto last = std::unique(copy.begin(), copy.end());
89 for (
auto el = copy.begin(); el != last; ++el) {
91 factor *= combinatorial(N, m);
100 for (
const auto& value :
counter)
107 std::ostream& operator<<(std::ostream& out, symmetricCounter<T>
const& c)
111 for (
const auto& value : c)
112 out << value << symmetricCounter<T>::separator;
119 bool increment(
size_t pos)
136 for (
auto iter =
counter.rbegin()+1; iter !=
counter.rend(); ++iter) {
139 else if (*iter > min)
Definition: symmetricCounter.h:32