CMS 3D CMS Logo

Combinatorics.h
Go to the documentation of this file.
1 /*
2  * Combinatorics.h
3  *
4  * 03/04/2006 kasselmann@physik.rwth-aachen.de
5  *
6  */
7 
8 #ifndef COMBINATORICS_H
9 #define COMBINATORICS_H
10 
11 // C++ header
12 #include <vector>
13 
14 // ROOT header
15 #include <TROOT.h>
16 
18 public:
19  Combinatorics(Int_t Set, Int_t Subset);
20  virtual ~Combinatorics();
21 
22  std::vector<std::vector<UInt_t> > GetPermutations();
23  std::vector<std::vector<UInt_t> > GetCombinations();
24  std::vector<std::vector<UInt_t> > GetCombinations_2_0();
25  std::vector<std::vector<UInt_t> > GetCombinations_2_2();
26  std::vector<std::vector<UInt_t> > GetCombinations_N_1();
27 
28  Int_t EqualPermutation(const std::vector<UInt_t>& permutation1, const std::vector<UInt_t>& permutation2);
29  Int_t EqualPermutation_2_0(const std::vector<UInt_t>& permutation1, const std::vector<UInt_t>& permutation2);
30  Int_t EqualPermutation_2_2(const std::vector<UInt_t>& permutation1, const std::vector<UInt_t>& permutation2);
31  Int_t EqualPermutation_N_1(const std::vector<UInt_t>& permutation1, const std::vector<UInt_t>& permutation2);
32 
33  void Print(const std::vector<UInt_t>& permutation);
34  void Print(const std::vector<std::vector<UInt_t> >& permutations);
35 
36 private:
37  Int_t CalculatePermutations();
38 
39  void initial_permutation(int size, int* permutation);
40  Bool_t next_permutation(int size, int* permutation);
41  void initial_subset(int k, int* subset);
42  Bool_t next_subset(int n, int k, int* subset);
43 
44  void Skip_2_0(const std::vector<std::vector<UInt_t> >& permutation1, std::vector<std::vector<UInt_t> >& permutation2);
45  void Skip_2_2(const std::vector<std::vector<UInt_t> >& permutation1, std::vector<std::vector<UInt_t> >& permutation2);
46 
47  std::vector<UInt_t> Rotate(const std::vector<UInt_t>& permutation, UInt_t digits);
48 
49  const Int_t m_SetQuantity;
50  const Int_t m_SubsetQuantity;
51 
52  std::vector<UInt_t> m_Subset;
53  std::vector<std::vector<UInt_t> > m_Permutations;
54  std::vector<std::vector<UInt_t> > m_Combinations;
55 };
56 
57 #endif
Combinatorics::Rotate
std::vector< UInt_t > Rotate(const std::vector< UInt_t > &permutation, UInt_t digits)
Definition: Combinatorics.cc:380
Combinatorics::GetCombinations_N_1
std::vector< std::vector< UInt_t > > GetCombinations_N_1()
Definition: Combinatorics.cc:353
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
Combinatorics::Skip_2_2
void Skip_2_2(const std::vector< std::vector< UInt_t > > &permutation1, std::vector< std::vector< UInt_t > > &permutation2)
Definition: Combinatorics.cc:275
Combinatorics::CalculatePermutations
Int_t CalculatePermutations()
Definition: Combinatorics.cc:41
Combinatorics::m_SubsetQuantity
const Int_t m_SubsetQuantity
Definition: Combinatorics.h:50
Combinatorics::m_Subset
std::vector< UInt_t > m_Subset
Definition: Combinatorics.h:52
Combinatorics::Print
void Print(const std::vector< UInt_t > &permutation)
Definition: Combinatorics.cc:405
Combinatorics::initial_subset
void initial_subset(int k, int *subset)
Definition: Combinatorics.cc:80
Combinatorics::GetPermutations
std::vector< std::vector< UInt_t > > GetPermutations()
Definition: Combinatorics.cc:36
Combinatorics::GetCombinations_2_0
std::vector< std::vector< UInt_t > > GetCombinations_2_0()
Definition: Combinatorics.cc:230
Combinatorics
Definition: Combinatorics.h:17
Combinatorics::next_subset
Bool_t next_subset(int n, int k, int *subset)
Definition: Combinatorics.cc:131
Combinatorics::EqualPermutation_2_2
Int_t EqualPermutation_2_2(const std::vector< UInt_t > &permutation1, const std::vector< UInt_t > &permutation2)
Definition: Combinatorics.cc:315
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Combinatorics::Skip_2_0
void Skip_2_0(const std::vector< std::vector< UInt_t > > &permutation1, std::vector< std::vector< UInt_t > > &permutation2)
Definition: Combinatorics.cc:254
Combinatorics::GetCombinations
std::vector< std::vector< UInt_t > > GetCombinations()
Definition: Combinatorics.cc:159
Combinatorics::m_SetQuantity
const Int_t m_SetQuantity
Definition: Combinatorics.h:49
Combinatorics::~Combinatorics
virtual ~Combinatorics()
Definition: Combinatorics.cc:31
Combinatorics::m_Combinations
std::vector< std::vector< UInt_t > > m_Combinations
Definition: Combinatorics.h:54
Combinatorics::m_Permutations
std::vector< std::vector< UInt_t > > m_Permutations
Definition: Combinatorics.h:53
Combinatorics::GetCombinations_2_2
std::vector< std::vector< UInt_t > > GetCombinations_2_2()
Definition: Combinatorics.cc:203
Combinatorics::initial_permutation
void initial_permutation(int size, int *permutation)
Definition: Combinatorics.cc:71
Combinatorics::EqualPermutation
Int_t EqualPermutation(const std::vector< UInt_t > &permutation1, const std::vector< UInt_t > &permutation2)
Definition: Combinatorics.cc:179
Combinatorics::EqualPermutation_2_0
Int_t EqualPermutation_2_0(const std::vector< UInt_t > &permutation1, const std::vector< UInt_t > &permutation2)
Definition: Combinatorics.cc:297
Combinatorics::Combinatorics
Combinatorics(Int_t Set, Int_t Subset)
Definition: Combinatorics.cc:19
Combinatorics::next_permutation
Bool_t next_permutation(int size, int *permutation)
Definition: Combinatorics.cc:89
Combinatorics::EqualPermutation_N_1
Int_t EqualPermutation_N_1(const std::vector< UInt_t > &permutation1, const std::vector< UInt_t > &permutation2)
Definition: Combinatorics.cc:337
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443