#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/core/ArrayBase.hpp>
Inherited by axom::Array< axom::primal::Polygon >, axom::Array< axom::primal::Octahedron >, axom::Array< IndexType, DIM >, axom::Array< T, 2 >, axom::Array< PointType, 2 >, axom::Array< axom::slam::DynamicVariableRelation >, axom::Array< IndexType >, axom::Array< axom::IndexType >, axom::Array< Word, 1 >, axom::Array< axom::primal::CurvedPolygon< axom::primal::NURBSCurve< double, 2 > > >, axom::Array< double >, axom::Array< CurveType >, axom::Array< float >, axom::Array< axom::slam::ProductSet >, axom::Array< axom::slam::GenericRangeSet >, axom::Array< T, 1, MemorySpace::Dynamic, detail::SidreStoragePolicy< T > >, axom::Array< Point< double, 3 > >, axom::Array< int >, axom::Array< axom::primal::NURBSCurve >, axom::Array< TrimmingCurveType >, axom::Array< axom::slam::RelationSet >, axom::Array< double, 2 >, axom::Array< axom::primal::NURBSPatch >, axom::Array< std::complex< double > >, axom::Array< CellType >, axom::Array< detail::flat_map::GroupBucket >, axom::Array< T, 1, MemorySpace::Dynamic, detail::ExternalStoragePolicy< T > >, axom::Array< std::uint8_t >, axom::Array< SetPosType >, axom::Array< PairStorage >, axom::Array< axom::primal::Triangle >, axom::Array< axom::primal::Segment >, axom::Array< PositionType >, axom::Array< std::int32_t >, axom::Array< axom::quest::GWNMomentData >, axom::Array< Hexahedron< double, 3 > >, axom::Array< axom::primal::BoundingBox >, axom::Array< Tetrahedron< double, 3 > >, axom::Array< PointType >, axom::Array< axom::slam::StaticRelation >, axom::ArrayView< ConnectivityType >, axom::ArrayView< axom::IndexType >, axom::ArrayView< IndexType >, axom::ArrayView< const axom::IndexType, 2 >, axom::ArrayView< double >, axom::ArrayView< float >, axom::ArrayView< const detail::flat_map::GroupBucket >, axom::ArrayView< DataType, Dims+1 >, axom::ArrayView< const axom::primal::NURBSCurve >, axom::ArrayView< const axom::slam::BitSet >, axom::ArrayView< FloatType >, axom::ArrayView< MaterialID >, axom::ArrayView< DataType, Dims >, axom::ArrayView< std::uint8_t >, axom::ArrayView< DataType >, axom::ArrayView< PairStorage >, axom::ArrayView< ConnType >, axom::ArrayView< const IndexType >, axom::ArrayView< const axom::primal::NURBSPatch >, axom::ArrayView< std::int32_t >, axom::ArrayView< ElementType >, and axom::ArrayView< PointType >.
|
| using | RealConstT = typename std::conditional< is_array_view, T, const T >::type |
| |
| template<int IdxDim> |
| using | SliceType = typename std::conditional< DIM==IdxDim, T &, typename detail::SubsliceProxy< T, DIM - IdxDim, ArrayType >::type >::type |
| |
| template<int IdxDim> |
| using | ConstSliceType = typename std::conditional< DIM==IdxDim, RealConstT &, typename detail::SubsliceProxy< T, DIM - IdxDim, const ArrayType >::type >::type |
| |
|
| AXOM_SUPPRESS_HD_WARN AXOM_HOST_DEVICE | ArrayBase () |
| | Construct row-major, unitnitialized array. More...
|
| |
| AXOM_SUPPRESS_HD_WARN AXOM_HOST_DEVICE | ArrayBase (const StackArray< IndexType, DIM > &shape, int min_stride=1) |
| | Parameterized constructor that sets up the array shape. More...
|
| |
| AXOM_SUPPRESS_HD_WARN AXOM_HOST_DEVICE | ArrayBase (const StackArray< IndexType, DIM > &shape, const MDMapping< DIM > &mapping) |
| | Parameterized constructor that sets up the array shape, with an MDMapping to specify data ordering. More...
|
| |
| AXOM_HOST_DEVICE | ArrayBase (const StackArray< IndexType, DIM > &shape, const StackArray< IndexType, DIM > &stride) |
| | Parameterized constructor that sets up the array shape and stride. More...
|
| |
| template<typename OtherArrayType > |
| AXOM_HOST_DEVICE | ArrayBase (const ArrayBase< typename std::remove_const< T >::type, 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 OtherArrayType > |
| AXOM_HOST_DEVICE | ArrayBase (const ArrayBase< const typename std::remove_const< T >::type, DIM, OtherArrayType > &other) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
| |
| template<typename... Args> |
| 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...
|
| |
| template<typename... Args> |
| 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...
|
| |
| template<int UDim> |
| 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...
|
| |
| template<int UDim> |
| 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 MDMapping< DIM > & | mapping () const |
| | Returns the multidimensional mapping for 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 & | 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...
|
| |
|
| constexpr static int | Dims = DIM |
| |
◆ RealConstT
template<typename T , int DIM, typename ArrayType >
◆ SliceType
template<typename T , int DIM, typename ArrayType >
template<int IdxDim>
◆ ConstSliceType
template<typename T , int DIM, typename ArrayType >
template<int IdxDim>
◆ ArrayBase() [1/6]
template<typename T , int DIM, typename ArrayType >
◆ ArrayBase() [2/6]
template<typename T , int DIM, typename ArrayType >
Parameterized constructor that sets up the array shape.
- Parameters
-
| [in] | shape | Array size in each direction. |
| [in] | min_stride | The minimum stride between two consecutive elements in row-major order. |
References axom::ROW.
◆ ArrayBase() [3/6]
template<typename T , int DIM, typename ArrayType >
Parameterized constructor that sets up the array shape, with an MDMapping to specify data ordering.
- Parameters
-
| [in] | shape | Array size in each direction. |
| [in] | mapping | Model mapper, specifying the array stride order and minimum stride. |
The object is constructed with the given shape, not the partial shape information in mapping.
◆ ArrayBase() [4/6]
template<typename T , int DIM, typename ArrayType >
◆ ArrayBase() [5/6]
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.
◆ ArrayBase() [6/6]
template<typename T , int DIM, typename ArrayType >
template<typename OtherArrayType >
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 >
template<typename... 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.
- Parameters
-
| [in] | args | the parameter pack of indices in each dimension. |
- Note
- equivalent to *(array.data() + idx).
- Precondition
- sizeof...(Args) <= DIM
-
0 <= args[i] < shape()[i] for i in [0, sizeof...(Args))
◆ operator()() [2/2]
template<typename T , int DIM, typename ArrayType >
template<typename... Args>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ operator[]() [1/4]
template<typename T , int DIM, typename ArrayType >
Scalar accessor; returns a sub-array referenced by the given sub- index, beginning at array(idx, 0...)
- Parameters
-
| [in] | idx | the index of the first dimension. |
- Precondition
- 0 <= idx < shape()[0]
References axom::primal::slice().
◆ operator[]() [2/4]
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.
References axom::primal::slice().
◆ operator[]() [3/4]
template<typename T , int DIM, typename ArrayType >
template<int UDim>
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.
- Parameters
-
| [in] | args | a stack array of indices in each dimension. |
- Note
- equivalent to *(array.data() + idx).
- Precondition
- UDim <= DIM
-
0 <= args[i] < shape()[i] for i in [0, UDim)
◆ operator[]() [4/4]
template<typename T , int DIM, typename ArrayType >
template<int UDim>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ flatIndex() [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 * minStride()).
- Precondition
- 0 <= idx < asDerived().size()
◆ flatIndex() [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.
◆ swap()
template<typename T , int DIM, typename ArrayType >
◆ shape()
template<typename T , int DIM, typename ArrayType >
◆ mapping()
template<typename T , int DIM, typename ArrayType >
◆ strides()
template<typename T , int DIM, typename ArrayType >
◆ minStride()
template<typename T , int DIM, typename ArrayType >
◆ setShape()
template<typename T , int DIM, typename ArrayType >
◆ setShapeAndStride()
template<typename T , int DIM, typename ArrayType >
Set the shape and stride.
References axom::ArrayBase< T, DIM, ArrayType >::m_mapping, axom::ArrayBase< T, DIM, ArrayType >::m_minStride, axom::ArrayBase< T, DIM, ArrayType >::m_shape, and axom::ArrayBase< T, DIM, ArrayType >::shape().
◆ 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.
References axom::ArrayBase< T, DIM, ArrayType >::m_mapping.
◆ updateStrides()
template<typename T , int DIM, typename ArrayType >
◆ updateShapeOnInsert()
template<typename T , int DIM, typename ArrayType >
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.
References axom::StackArray< T, N >::begin(), axom::StackArray< T, N >::end(), axom::ArrayBase< T, DIM, ArrayType >::m_shape, axom::utilities::processAbort(), and axom::ArrayBase< T, DIM, ArrayType >::updateStrides().
◆ Dims
template<typename T , int DIM, typename ArrayType >
◆ m_shape
template<typename T , int DIM, typename ArrayType >
The extent in each direction.
◆ m_mapping
template<typename T , int DIM, typename ArrayType >
For converting between multidim indices and offset.
◆ m_minStride
template<typename T , int DIM, typename ArrayType >
Cached value for optimization.
- See also
- minStride()
For some reason, computing min stride in minStride() slows down flatIndex() for CUDA and HIP, even though it doesn't seem tricky to optimize. As a work around, we cache the value in m_minStrides and update it when m_mapping changes. BTNG, March 2024.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/core/ArrayBase.hpp