Provides a view over a generic array container.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.0/src/axom/core/ArrayView.hpp>
|
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...
|
|
template<typename T, int DIM = 1>
class axom::ArrayView< T, DIM >
Provides a view over a generic array container.
The ArrayView expresses a non-owning relationship over a pointer
- Template Parameters
-
T | the type of the values to hold. |
DIM | The dimension of the array. |
◆ value_type
template<typename T , int DIM = 1>
◆ ArrayViewIterator
template<typename T , int DIM = 1>
◆ ArrayView() [1/2]
template<typename T , int DIM = 1>
◆ ArrayView() [2/2]
template<typename T , int DIM>
template<typename... Args>
Generic constructor for an ArrayView of arbitrary dimension with external data.
- Parameters
-
[in] | data | the external data this ArrayView will wrap. |
[in] | args | The parameter pack containing the "shape" of the ArrayView |
- Precondition
- sizeof...(Args) == DIM
- Postcondition
- size() == num_elements
References axom::detail::packProduct().
◆ size()
template<typename T , int DIM = 1>
◆ begin()
template<typename T , int DIM = 1>
Returns an ArrayViewIterator to the first element of the Array.
◆ end()
template<typename T , int DIM = 1>
◆ data() [1/2]
template<typename T , int DIM = 1>
Return a pointer to the array of data.
◆ data() [2/2]
template<typename T , int DIM = 1>
◆ getAllocatorID()
template<typename T , int DIM = 1>
Get the ID for the umpire allocator.
FIXME: This is just a stand-in impl, extend this class to support wrapping of GPU pointers
References axom::getDefaultAllocatorID().
◆ operator()() [1/2]
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]
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]
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]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ shape()
Returns the dimensions of the Array.
◆ strides()
Returns the strides of the Array.
◆ insert()
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()
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()
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.
◆ dimension
template<typename T , int DIM = 1>
◆ m_dims
The sizes (extents?) in each dimension.
◆ m_strides
The strides in each dimension.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.0/src/axom/core/ArrayView.hpp