AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Proxy class for efficiently constructing slice ArrayViews by using the generic ArrayBase constructor in ArrayView. This avoids the cost of looking up the correct allocator ID from the other ArrayView constructors. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/core/ArrayBase.hpp>
Public Types | |
using | RealConstT = typename std::conditional< is_array_view, T, const T >::type |
using | ConstSliceType = typename std::conditional< DIM==IdxDim, RealConstT &, typename detail::SubsliceProxy< T, DIM - IdxDim, const ArraySubslice< T, SliceDim, BaseArray > >::type >::type |
Public Member Functions | |
AXOM_HOST_DEVICE | ArraySubslice (BaseArray *array, const StackArray< IndexType, NumIndices > &idxs) |
AXOM_HOST_DEVICE IndexType | size () const |
Return the number of elements stored in the data array. More... | |
IndexType | spacing () const |
int | getAllocatorID () const |
Get the ID for the umpire allocator. More... | |
AXOM_HOST_DEVICE SliceType< sizeof...(Args)> | operator() (Args... args) |
Dimension-aware accessor; with N=DIM indices, returns a reference to the given value at that index. Otherwise, returns a sub-array pointed to by the given sub-index. More... | |
AXOM_HOST_DEVICE ConstSliceType< sizeof...(Args)> | operator() (Args... args) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
AXOM_HOST_DEVICE SliceType< 1 > | operator[] (const IndexType idx) |
Scalar accessor; returns a sub-array referenced by the given sub- index, beginning at array(idx, 0...) More... | |
AXOM_HOST_DEVICE ConstSliceType< 1 > | operator[] (const IndexType idx) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
AXOM_HOST_DEVICE SliceType< UDim > | operator[] (const StackArray< IndexType, UDim > &idx) |
Dimension-aware accessor; with UDim=DIM indices, returns a reference to the given value at that index. Otherwise, returns a sub-array pointed to by the given sub-index. More... | |
AXOM_HOST_DEVICE ConstSliceType< UDim > | operator[] (const StackArray< IndexType, UDim > &idx) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | swap (ArrayBase &other) |
Swaps two ArrayBases. More... | |
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 memory strides of the Array. More... | |
AXOM_HOST_DEVICE IndexType | minStride () const |
Returns the minimum stride between adjacent items. More... | |
AXOM_HOST_DEVICE T * | data () const |
Return a pointer to the array of data. More... | |
AXOM_HOST_DEVICE T & | flatIndex (const IndexType idx) |
Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data. More... | |
AXOM_HOST_DEVICE RealConstT & | flatIndex (const IndexType idx) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Static Public Attributes | |
constexpr static int | Dims |
Protected Member Functions | |
template<int UDim> | |
AXOM_HOST_DEVICE SliceType< UDim > | sliceImpl (const StackArray< IndexType, UDim > &idx) const |
AXOM_HOST_DEVICE void | setShape (const StackArray< IndexType, DIM > &shape_) |
Set the shape. More... | |
AXOM_HOST_DEVICE void | setShapeAndStride (const StackArray< IndexType, DIM > &shape, const StackArray< IndexType, DIM > &stride) |
Set the shape and stride. More... | |
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... | |
AXOM_HOST_DEVICE void | updateStrides () |
Updates the internal striding information to a row-major format Intended to be called after shape is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding. More... | |
void | updateShapeOnInsert (const StackArray< IndexType, DIM > &range_shape) |
Updates the internal dimensions and striding based on the insertion of a range of elements. Intended to be called after the insertion of a multidimensional subslice. More... | |
Protected Attributes | |
friend | BaseClass |
StackArray< IndexType, DIM > | m_shape |
The extent in each direction. More... | |
StackArray< IndexType, DIM > | m_strides |
Logical strides in each direction. More... | |
Proxy class for efficiently constructing slice ArrayViews by using the generic ArrayBase constructor in ArrayView. This avoids the cost of looking up the correct allocator ID from the other ArrayView constructors.
|
inherited |
|
inherited |
|
inline |
|
inline |
Return the number of elements stored in the data array.
|
inline |
Return a pointer to the array of data.
References axom::StackArray< T, N >::begin(), and axom::numerics::dot_product().
|
inline |
|
inline |
Get the ID for the umpire allocator.
|
inlineprotected |
|
inlineinherited |
Dimension-aware accessor; with N=DIM indices, returns a reference to the given value at that index. Otherwise, returns a sub-array pointed to by the given sub-index.
[in] | args | the parameter pack of indices in each dimension. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Scalar accessor; returns a sub-array referenced by the given sub- index, beginning at array(idx, 0...)
[in] | idx | the index of the first dimension. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Dimension-aware accessor; with UDim=DIM indices, returns a reference to the given value at that index. Otherwise, returns a sub-array pointed to by the given sub-index.
[in] | args | a stack array of indices in each dimension. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data.
[in] | idx | the position of the value to return. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Swaps two ArrayBases.
|
inlineinherited |
Returns the dimensions of the Array.
|
inlineinherited |
Returns the memory strides of the Array.
|
inlineinherited |
Returns the minimum stride between adjacent items.
|
inlineprotectedinherited |
Set the shape.
|
inlineprotectedinherited |
Set the shape and stride.
|
inlineprotectedinherited |
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.
|
inlineprotectedinherited |
Updates the internal striding information to a row-major format Intended to be called after shape is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding.
|
inlineprotectedinherited |
Updates the internal dimensions and striding based on the insertion of a range of elements. Intended to be called after the insertion of a multidimensional subslice.
|
protected |
|
staticconstexprinherited |
|
protectedinherited |
The extent in each direction.
|
protectedinherited |
Logical strides in each direction.