#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/core/ArrayBase.hpp>
|
template<typename... Args> |
| ArrayBase (Args... args) |
| Parameterized constructor that sets up the default strides. More...
|
|
template<typename OtherArrayType > |
| ArrayBase (const ArrayBase< T, DIM, OtherArrayType > &other) |
| Copy constructor for arrays of different type Because the element type (T) and dimension (DIM) are still locked down, this function is nominally used for copying ArrayBase metadata from Array <-> ArrayView and/or Array-like objects whose data are in different memory spaces. More...
|
|
template<typename... Args, typename SFINAE = typename std::enable_if<sizeof...(Args) == DIM>::type> |
AXOM_HOST_DEVICE T & | operator() (Args... args) |
| Dimension-aware accessor, returns a reference to the given value. More...
|
|
template<typename... Args, typename SFINAE = typename std::enable_if<sizeof...(Args) == DIM>::type> |
AXOM_HOST_DEVICE const T & | operator() (Args... args) const |
|
AXOM_HOST_DEVICE const StackArray< IndexType, DIM > & | shape () const |
| Returns the dimensions of the Array. More...
|
|
AXOM_HOST_DEVICE const StackArray< IndexType, DIM > & | strides () const |
| Returns the strides of the Array. More...
|
|
template<typename OtherArrayType > |
void | insert (IndexType pos, const ArrayBase< T, DIM, OtherArrayType > &other) |
| Appends an Array to the end of the calling object. More...
|
|
|
AXOM_HOST_DEVICE T & | operator[] (const IndexType idx) |
| Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data. More...
|
|
AXOM_HOST_DEVICE const T & | operator[] (const IndexType idx) const |
|
|
IndexType | blockSize () const |
| Returns the minimum "chunk size" that should be allocated For example, 2 would be the chunk size of a 2D array whose second dimension is of size 2. This is used when resizing/reallocating; it wouldn't make sense to have a capacity of 3 in the array described above. More...
|
|
void | updateStrides () |
| Updates the internal striding information to a row-major format Intended to be called after m_dims is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding. More...
|
|
◆ ArrayBase() [1/2]
template<typename T, int DIM, typename ArrayType>
template<typename... Args>
Parameterized constructor that sets up the default strides.
- Parameters
-
[in] | args | the parameter pack of sizes in each dimension. |
◆ ArrayBase() [2/2]
template<typename T, int DIM, typename ArrayType>
template<typename OtherArrayType >
Copy constructor for arrays of different type Because the element type (T) and dimension (DIM) are still locked down, this function is nominally used for copying ArrayBase metadata from Array <-> ArrayView and/or Array-like objects whose data are in different memory spaces.
◆ operator()() [1/2]
template<typename T, int DIM, typename ArrayType>
template<typename... Args, typename SFINAE = typename std::enable_if<sizeof...(Args) == DIM>::type>
Dimension-aware accessor, returns a reference to the given value.
- Parameters
-
[in] | args | the parameter pack of indices in each dimension. |
- Note
- equivalent to *(array.data() + idx).
- Precondition
- sizeof...(Args) == DIM
-
0 <= args[i] < m_dims[i] for i in [0, DIM)
◆ operator()() [2/2]
template<typename T, int DIM, typename ArrayType>
template<typename... Args, typename SFINAE = typename std::enable_if<sizeof...(Args) == DIM>::type>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ operator[]() [1/2]
template<typename T, int DIM, typename ArrayType>
Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data.
- Parameters
-
[in] | idx | the position of the value to return. |
- Note
- equivalent to *(array.data() + idx).
- Precondition
- 0 <= idx < m_num_elements
◆ operator[]() [2/2]
template<typename T, int DIM, typename ArrayType>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ shape()
template<typename T, int DIM, typename ArrayType>
◆ strides()
template<typename T, int DIM, typename ArrayType>
Returns the strides of the Array.
◆ insert()
template<typename T, int DIM, typename ArrayType>
template<typename OtherArrayType >
Appends an Array to the end of the calling object.
- Parameters
-
[in] | other | The Array to append |
- Precondition
- The shapes of the calling Array and other are the same (excluding the leading dimension), i.e., shape()[1:] == other.shape()[1:]
- Note
- Reallocation is done if the new size will exceed the capacity.
◆ blockSize()
template<typename T, int DIM, typename ArrayType>
Returns the minimum "chunk size" that should be allocated For example, 2 would be the chunk size of a 2D array whose second dimension is of size 2. This is used when resizing/reallocating; it wouldn't make sense to have a capacity of 3 in the array described above.
◆ updateStrides()
template<typename T, int DIM, typename ArrayType>
Updates the internal striding information to a row-major format Intended to be called after m_dims
is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding.
Referenced by axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::ArrayBase(), and axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::insert().
◆ swap
template<typename T, int DIM, typename ArrayType>
◆ m_dims
template<typename T, int DIM, typename ArrayType>
The sizes (extents?) in each dimension.
Referenced by axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::insert(), axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::shape(), and axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::updateStrides().
◆ m_strides
template<typename T, int DIM, typename ArrayType>
The strides in each dimension.
Referenced by axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::blockSize(), axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::operator()(), axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::strides(), and axom::ArrayBase< T, DIM, Array< T, DIM, MemorySpace::Dynamic > >::updateStrides().
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/core/ArrayBase.hpp