#include <IndexSet.h>
|
| | IndexSet () |
| | default constructor: the number of indices is set to 0
|
| | IndexSet (const unsigned int &r_nb_indices) |
| | constructor: the number of indices is set to r_nb_indices
|
| | IndexSet (const unsigned int &r_nb_indices, const std::vector< int > &r_index) |
| | constructor: the number of indices is set to r_nb_indices, the vector r_index contains the indices
|
| unsigned int | size () const |
| | get the number of indices
|
| void | resize (const unsigned int &r_size) |
| | resize the index set to r_size; the index store is preserved as far as possible
|
| int | operator[] (const unsigned int &r_k) |
| | :::::::::::::::::::::::
|
| int | operator[] (const unsigned int &r_k) const |
| | access to the indices stored in the class, 0 <= r_k < size(); WARNING: no test on the index is performed
|
| void | sort () |
| | sort the indices in ascending order
|
| bool | operator== (const IndexSet &r_index_set) const |
| bool | operator!= (const IndexSet &r_index_set) const |
| | comparison of two index sets; two index sets are considered equal if they are of the same size and their indices are the same at the same position [.
|
|
| void | init () |
| void | init (const unsigned int &r_nb_indices) |
| void | init (const unsigned int &r_nb_indices, const std::vector< int > &r_index) |
Definition at line 40 of file IndexSet.h.
◆ IndexSet() [1/3]
| MuonCalib::IndexSet::IndexSet |
( |
| ) |
|
|
inline |
default constructor: the number of indices is set to 0
Definition at line 57 of file IndexSet.h.
◆ IndexSet() [2/3]
| MuonCalib::IndexSet::IndexSet |
( |
const unsigned int & | r_nb_indices | ) |
|
|
inline |
constructor: the number of indices is set to r_nb_indices
Definition at line 60 of file IndexSet.h.
◆ IndexSet() [3/3]
| MuonCalib::IndexSet::IndexSet |
( |
const unsigned int & | r_nb_indices, |
|
|
const std::vector< int > & | r_index ) |
|
inline |
constructor: the number of indices is set to r_nb_indices, the vector r_index contains the indices
Definition at line 63 of file IndexSet.h.
◆ init() [1/3]
Definition at line 27 of file IndexSet.cxx.
27 {
29 return;
30}
unsigned int m_nb_indices
◆ init() [2/3]
| void IndexSet::init |
( |
const unsigned int & | r_nb_indices | ) |
|
|
private |
Definition at line 38 of file IndexSet.cxx.
38 {
41 return;
42}
std::vector< int > m_index
◆ init() [3/3]
| void IndexSet::init |
( |
const unsigned int & | r_nb_indices, |
|
|
const std::vector< int > & | r_index ) |
|
private |
Definition at line 50 of file IndexSet.cxx.
50 {
52
54
55 if (r_index.size() < r_nb_indices) {
56 throw std::runtime_error(Form("File: %s, Line: %d\nIndexSet::init() - Index vector too short!", __FILE__, __LINE__));
57 }
58
60
62
66 if (k < r_index.size()) {
68 } else {
70 }
71 }
72
73 return;
74}
◆ operator!=()
| bool IndexSet::operator!= |
( |
const IndexSet & | r_index_set | ) |
const |
comparison of two index sets; two index sets are considered equal if they are of the same size and their indices are the same at the same position [.
]
Definition at line 164 of file IndexSet.cxx.
164{ return !(*this == r_index_set); }
◆ operator==()
| bool IndexSet::operator== |
( |
const IndexSet & | r_index_set | ) |
const |
Definition at line 148 of file IndexSet.cxx.
148 {
150
152 if (
m_index[k] != r_index_set[k]) {
return false; }
153 }
154
155 return true;
156}
unsigned int size() const
get the number of indices
◆ operator[]() [1/2]
| int IndexSet::operator[] |
( |
const unsigned int & | r_k | ) |
|
◆ operator[]() [2/2]
| int IndexSet::operator[] |
( |
const unsigned int & | r_k | ) |
const |
access to the indices stored in the class, 0 <= r_k < size(); WARNING: no test on the index is performed
Definition at line 129 of file IndexSet.cxx.
◆ resize()
| void IndexSet::resize |
( |
const unsigned int & | r_size | ) |
|
resize the index set to r_size; the index store is preserved as far as possible
Definition at line 90 of file IndexSet.cxx.
90 {
91
92
93
94
95 std::vector<int> aux_index =
m_index;
96
97
98
99
100
101
102 m_index = std::vector<int>(r_size);
103 for (
unsigned int k = 0;
k < r_size;
k++) {
106 } else {
108 }
109 }
111
112 return;
113}
◆ size()
| unsigned int IndexSet::size |
( |
| ) |
const |
◆ sort()
sort the indices in ascending order
Definition at line 137 of file IndexSet.cxx.
137 {
139 return;
140}
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
◆ m_index
| std::vector<int> MuonCalib::IndexSet::m_index |
|
private |
◆ m_nb_indices
| unsigned int MuonCalib::IndexSet::m_nb_indices |
|
private |
The documentation for this class was generated from the following files: