13 : m_maxes( collectionSizes ),
14 m_current( m_maxes.
size() ) {
22 [](
size_t m ){ return m == 0; } ) )
45 : m_nElements(nelems),
47 m_current(m_combLen) {
52 CombinationGenerator::operator
bool()
const {
53 return not m_current.empty();
63 UniqueCombinationGenerator::operator
bool()
const {
64 return not m_current.empty();
116 NestedUniqueCombinationGenerator::operator
bool()
const {
117 return not m_current.empty();
131 for (
auto position:
indices[rank] ) {
133 if (
std::find( combination.begin(), combination.end(), position ) == combination.end() ) {
137 if ( combination.size() == rank )
138 combination.push_back( position );
140 combination[rank] = position;
142 if ( combination.size() ==
indices.size() ) {
143 if (
filter( combination ) )
144 handle( combination );
146 combMaker(
indices, std::move(handle), std::move(
filter), rank+1, combination);
155 auto handle = [&](
const Index1DVec& combination ) {
for (
auto el: combination ) participants.insert(participants.begin(),
el); };