|
ATLAS Offline Software
|
Go to the documentation of this file.
37 #ifndef CXXUTILS_ARRAY_H
38 #define CXXUTILS_ARRAY_H
50 template <
unsigned int N>
52 template <
unsigned int N>
73 template <
unsigned int N>
136 template <
unsigned int N>
182 std::vector<unsigned int>
shape()
const;
190 unsigned int size (
unsigned int dim = 0)
const;
313 std::vector<unsigned int>
shape()
const;
363 friend class Array<1>;
372 template <
unsigned int N>
393 template <
unsigned int N>
647 template <
unsigned int N>
774 template <
unsigned int N>
822 #include "CxxUtils/Array.icc"
833 #endif // not CXXUTILS_ARRAY_H
Arrayelt * m_elt_nc
Pointer to this array's single element, non-const copy.
Helper for defining iterators over Array's.
Read-write multidimensional array.
static const_iterator make_iterator(const Arrayrep *rep, unsigned int offs)
Construct an Array<N>::const_iterator.
Arrayrep * m_rep_nc
The underlying array representation, non-const copy.
ArrayIteratorChooser< N >::const_iterator const_iterator
The iterator for this container.
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
bool valid() const
Test for validity.
Array< N-1 > operator[](unsigned int i) const
Array indexing.
std::vector< unsigned int > shape() const
Return the array shape.
std::ostream & operator<<(std::ostream &s, const Array< N > &a)
value_type m_a
The contained Array proxy instance.
Array(const Arrayrep &rep)
Constructor.
bool const RAWDATA *ch2 const
const Arrayrep * m_rep
Pointer to the representation.
pointer operator->() const
Dereference the iterator.
ArrayIterator< N > & operator--()
Back up the iterator.
value_type operator[](difference_type n) const
Array indexing relative to the iterator.
WritableArrayData(const unsigned int shape[])
Constructor.
const_iterator end() const
Return an iterator pointing past the end of the container.
std::ptrdiff_t difference_type
static const_iterator make_iterator(const Arrayrep *rep, unsigned int offs)
Construct an Array<1>::const_iterator.
ArrayIterator< N > const_iterator
Iterator type for an Array<N>.
Proxy to return from operator>.
bool operator<=(const ArrayIterator &other) const
Less-than-or-equal comparison.
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
WritableArray(Arrayrep &rep)
Constructor.
const Arrayelt * ptr() const
Return a direct pointer to array elements.
Representation class for Array's.
bool operator!=(const ArrayIterator &other) const
Inequality comparison.
const value_type * operator->() const
Dereference the proxy.
Read-only multidimensional array.
WritableArrayData(const std::vector< unsigned int > &shape)
Constructor.
const Arrayelt * m_elt
Pointer to this array's single element.
std::random_access_iterator_tag iterator_category
WritableArray< N-1 > operator[](unsigned int i)
Array indexing.
ArrayIterator< N > operator-(difference_type n) const
Return a new iterator pointing n steps behind.
bool valid() const
Test for validity.
float Arrayelt
The type of an element of an Array.
const Arrayelt * const_iterator
Iterator type for an Array<1>.
Namespace for helper functions.
void write_array(std::ostream &stream) const
Creates a text representation of the array content.
ArrayIterator(const Arrayrep *rep, unsigned int offs)
Constructor from Arrayrep and offset.
unsigned int m_offs
Offset into the representation's data array of the first element referred to by this iterator.
ArrayIterator< N > & operator+=(difference_type n)
Advance the iterator.
bool operator==(const ArrayIterator &other) const
Equality comparison.
pointer(const ArrayIterator &i)
Proxy constructor.
Array()
Default constructor.
ArrayIterator< N > operator+(difference_type n) const
Return a new iterator pointing n steps ahead.
Compatibility helpers for using some pieces of C++20 concepts with older compilers.
const Arrayrep * m_rep
The underlying array representation.
unsigned int m_offs
Offset in the Arrayrep's data of the first element of this array.
ArrayIterator()
Default constructor.
Arrayelt * ptr()
Return a direct pointer to array elements.
bool operator<(const ArrayIterator &other) const
Less-than comparison.
ATH_REQUIRES(detail::IsConcurrentHashmapPayload< KEY > &&detail::IsConcurrentHashmapPayload< VALUE > &&detail::IsUpdater< UPDATER > &&detail::IsHash< HASHER, KEY > &&detail::IsBinaryPredicate< MATCHER, KEY >) class ConcurrentMap
Hash map from integers/pointers allowing concurrent, lockless reads.
Representation class for Array's.
ArrayIterator< N > & operator-=(difference_type n)
Back up the iterator.
void write_array(std::ostream &stream) const
Creates a text representation of the array content.
ArrayIterator< N > & operator++()
Advance the iterator.
value_type operator*() const
Dereference the iterator.
const_iterator begin() const
Return an iterator pointing at the beginning of the container.
Array()
Default constructor.
Iterator class for Array<N>.
WritableArray(Arrayrep &rep)
Constructor.
bool operator>=(const ArrayIterator &other) const
Greater-than-or-equal comparison.
std::vector< unsigned int > shape() const
Return the array shape.
value_type operator*() const
Dereference the proxy.
int asint() const
Convert to an integer.
Array(const Arrayrep &rep)
Constructor.
void fromArrayrep(const CaloRec::Arrayrep &rep, T &x)
Helper to convert from an @x Arrayrep to a scalar type.
bool operator>(const ArrayIterator &other) const
Greater-than comparison.