Celeritas
0.5.0-56+6b053cd
|
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 |
Public Member Functions | |
Element access | |
CELER_CONSTEXPR_FUNCTION const_reference | operator[] (size_type i) const |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION reference | operator[] (size_type i) |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION const_reference | front () const |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION reference | front () |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION const_reference | back () const |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION reference | back () |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION const_pointer | data () const |
Access for structured unpacking. | |
CELER_CONSTEXPR_FUNCTION pointer | data () |
Access for structured unpacking. | |
template<std::size_t I> | |
CELER_CONSTEXPR_FUNCTION T & | get () |
Access for structured unpacking. | |
template<std::size_t I> | |
CELER_CONSTEXPR_FUNCTION T const & | get () const |
Access for structured unpacking. | |
Iterators | |
CELER_CONSTEXPR_FUNCTION iterator | begin () |
CELER_CONSTEXPR_FUNCTION iterator | end () |
CELER_CONSTEXPR_FUNCTION const_iterator | begin () const |
CELER_CONSTEXPR_FUNCTION const_iterator | end () const |
CELER_CONSTEXPR_FUNCTION const_iterator | cbegin () const |
CELER_CONSTEXPR_FUNCTION const_iterator | cend () const |
Operations | |
Fill the array with a constant value | |
CELER_CONSTEXPR_FUNCTION void | fill (const_reference value) |
Public Attributes | |
T | data_ [N] |
Storage. | |
Capacity | |
CELER_CONSTEXPR_FUNCTION bool | empty () const |
static CELER_CONSTEXPR_FUNCTION 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
.
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