|
Celeritas 0.7.0-dev.168+develop.6e17e5869
|
Fixed-size simple array for storage. More...
#include <Array.hh>
Public Types | |
Type aliases | |
| using | value_type = T |
| using | size_type = ::celeritas::size_type |
| using | pointer = value_type * |
| using | const_pointer = value_type const * |
| using | reference = value_type & |
| using | const_reference = value_type const & |
| using | iterator = pointer |
| using | const_iterator = const_pointer |
| using | CArrayConstRef = T const(&)[N] |
Public Member Functions | |
| CELER_CEF | Array () |
| Default construction initializes to zero. | |
| CELER_CEF | Array (CArrayConstRef values) |
| Construct from an array for aggregate initialization of daughters. | |
| CELER_CEF | Array (T first) |
| Construct with C-style aggregate initialization. | |
| template<class... Us> | |
| CELER_CEF | Array (T first, Us... rest) |
| Construct with the array's data. | |
Element access | |
| CELER_CEF const_reference | operator[] (size_type i) const |
| CELER_CEF reference | operator[] (size_type i) |
| CELER_CEF const_reference | front () const |
| CELER_CEF reference | front () |
| CELER_CEF const_reference | back () const |
| CELER_CEF reference | back () |
| CELER_CEF const_pointer | data () const |
| CELER_CEF pointer | data () |
| template<std::size_t I> | |
| CELER_CEF T & | get () |
| template<std::size_t I> | |
| CELER_CEF T const & | get () const |
Iterators | |
| CELER_CEF iterator | begin () |
| CELER_CEF iterator | end () |
| CELER_CEF const_iterator | begin () const |
| CELER_CEF const_iterator | end () const |
| CELER_CEF const_iterator | cbegin () const |
| CELER_CEF const_iterator | cend () const |
Operations | |
| CELER_CEF void | fill (const_reference value) |
| Fill the array with a constant value. | |
Capacity | |
| CELER_CEF bool | empty () const |
| static CELER_CEF size_type | size () |
Fixed-size simple array for storage.
The Array class is primarily used for point coordinates (e.g., Real3) but is also used for other fixed-size data structures.
This isn't fully standards-compliant with std::array: there's no support for N=0 for example. Additionally it uses the native celeritas size_type, even though this has no effect on generated code for values of N inside the range of size_type. Arrays are also zero-initialized by default.
corecel/math/ArrayUtils.hh for real-number vector/matrix applicationscorecel/math/ArrayOperators.hh for mathematical operatorsArrayIO.hh for streaming and string conversionArrayIO.json.hh for JSON input and output
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking
|
inline |
Access for structured unpacking