|
ATLAS Offline Software
|
Go to the documentation of this file.
2 #ifndef FPGATrackSimGenScanArray_H
3 #define FPGATrackSimGenScanArray_H
51 void setsize(
const std::vector<unsigned int> &
dims,
const T &initval)
78 const std::vector<unsigned int> &
dims()
const {
return m_dims; }
84 throw std::runtime_error(
"FPGATrackSimGenScanArray: index size does not match array dimensions");
89 for (
unsigned int i = 0;
i <
m_step.size();
i++)
93 throw std::runtime_error(
"FPGATrackSimGenScanArray: index out of range i=" +
std::to_string(
i) +
107 std::vector<unsigned int> idx_unsigned;
109 idx_unsigned.push_back(
d);
110 return (*
this)[idx_unsigned];
140 throw std::runtime_error(
141 "FPGATrackSimGenScanArray::Interator array size mismatch in "
153 for (
unsigned int i = 0;
i <
m_idx.size() - 1;
i++)
164 const std::vector<unsigned int> &
idx()
const {
return m_idx; }
178 return a.m_idx !=
b.m_idx;
190 Iterator
begin() {
return Iterator(std::vector<unsigned int>(
m_dims.size(), 0), *
this); }
193 std::vector<unsigned int> retv;
195 retv.push_back(
d - 1);
196 return ++Iterator(retv, *
this);
206 #endif // FPGATrackSimGenScanArray_H
const std::vector< unsigned int > & dims() const
std::vector< unsigned int > m_step
Iterator(const std::vector< unsigned int > &idx, FPGATrackSimGenScanArray< T > &itrdata)
std::vector< unsigned int > m_idx
unsigned int size() const
const T & operator[](const std::vector< int > &idx) const
const std::vector< unsigned int > & idx() const
T & operator[](const std::vector< unsigned > &idx)
T & operator[](const std::vector< int > &idx)
FPGATrackSimGenScanArray< T > & m_itrdata
std::vector< unsigned int > m_dims
std::string to_string(const DetectorType &type)
const std::vector< T > & flatdata() const
friend bool operator==(const Iterator &a, const Iterator &b)
#define ATLAS_THREAD_SAFE
FPGATrackSimGenScanArray()=default
Define macros for attributes used to control the static checker.
void setsize(const std::vector< unsigned int > &dims, const T &initval)
friend bool operator!=(const Iterator &a, const Iterator &b)
FPGATrackSimGenScanArray(const std::vector< unsigned int > &dims, const T &initval)
std::forward_iterator_tag iterator_category
const T & operator[](const std::vector< unsigned int > &idx) const