Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
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 );
156 const auto handle = [&](
const Index1DVec& combination ) {
for (
auto el: combination ) participants.insert(participants.begin(),
el); };
std::vector< size_t > m_current
std::string find(const std::string &s)
return a remapped string
std::pair< long int, long int > indices
UniqueCombinationGenerator(size_t nelems, size_t comblen)
void operator++()
moves to the next combination
std::vector< size_t > Index1DVec
Unique combinations for case when one can not repeat the index (i.e.
CombinationGenerator(const std::initializer_list< size_t > &collectionSizes)
construct combnations maker with the sizes of collection to which it should be applied
std::vector< size_t > m_current
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
void add(const UniqueCombinationGenerator &gen)
void fill(H5::Group &out_file, size_t iterations)
void findUniqueCombinations(const Index2DVec &indices, std::vector< std::vector< size_t > > &combinations, const std::function< bool(const Index1DVec &)> &filter)
Creates unique combinations of elements.
std::vector< size_t > m_current
std::vector< UniqueCombinationGenerator > m_generators
Generator of unique combinations (no indices are repeated) API description.
def combinations(items, n)
std::vector< size_t > m_maxes
std::vector< Index1DVec > Index2DVec
std::vector< bool > m_bitmask
void elementsInUniqueCombinations(const Index2DVec &indices, std::set< size_t > &participants, const std::function< bool(const Index1DVec &)> &filter)
setBGCode setTAP setLVL2ErrorBits bool