AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::ArrayBase< T, 1, ArrayType > Class Template Reference

Array implementation specific to 1D Arrays. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.7.0/src/axom/core/ArrayBase.hpp>

Public Types

using RealConstT = typename std::conditional< is_array_view, T, const T >::type
 

Public Member Functions

AXOM_HOST_DEVICE ArrayBase (IndexType=0)
 
AXOM_HOST_DEVICE ArrayBase (const StackArray< IndexType, 1 > &)
 
template<typename OtherArrayType >
 ArrayBase (const ArrayBase< typename std::remove_const< T >::type, 1, OtherArrayType > &)
 
template<typename OtherArrayType >
 ArrayBase (const ArrayBase< const typename std::remove_const< T >::type, 1, OtherArrayType > &)
 
AXOM_HOST_DEVICE StackArray< IndexType, 1 > shape () const
 Returns the dimensions of the Array. More...
 
void swap (ArrayBase &)
 Swaps two ArrayBases No member data, so this is a no-op. 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 RealConstToperator[] (const IndexType idx) const
 
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 RealConstTflatIndex (const IndexType idx) const
 

Protected Member Functions

IndexType blockSize () const
 Returns the minimum "chunk size" that should be allocated. More...
 
void updateShapeOnInsert (const StackArray< IndexType, 1 > &)
 Updates the internal dimensions and striding based on the insertion of a range of elements. No-op, since we don't keep any shape information in this specialization. More...
 

Detailed Description

template<typename T, typename ArrayType>
class axom::ArrayBase< T, 1, ArrayType >

Array implementation specific to 1D Arrays.

Member Typedef Documentation

◆ RealConstT

template<typename T , typename ArrayType >
using axom::ArrayBase< T, 1, ArrayType >::RealConstT = typename std::conditional<is_array_view, T, const T>::type

Constructor & Destructor Documentation

◆ ArrayBase() [1/4]

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE axom::ArrayBase< T, 1, ArrayType >::ArrayBase ( IndexType  = 0)
inline

◆ ArrayBase() [2/4]

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE axom::ArrayBase< T, 1, ArrayType >::ArrayBase ( const StackArray< IndexType, 1 > &  )
inline

◆ ArrayBase() [3/4]

template<typename T , typename ArrayType >
template<typename OtherArrayType >
axom::ArrayBase< T, 1, ArrayType >::ArrayBase ( const ArrayBase< typename std::remove_const< T >::type, 1, OtherArrayType > &  )
inline

◆ ArrayBase() [4/4]

template<typename T , typename ArrayType >
template<typename OtherArrayType >
axom::ArrayBase< T, 1, ArrayType >::ArrayBase ( const ArrayBase< const typename std::remove_const< T >::type, 1, OtherArrayType > &  )
inline

Member Function Documentation

◆ shape()

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE StackArray<IndexType, 1> axom::ArrayBase< T, 1, ArrayType >::shape ( ) const
inline

Returns the dimensions of the Array.

◆ operator[]() [1/2]

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE T& axom::ArrayBase< T, 1, ArrayType >::operator[] ( const IndexType  idx)
inline

Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data.

Parameters
[in]idxthe position of the value to return.
Note
equivalent to *(array.data() + idx).
Precondition
0 <= idx < m_num_elements

◆ operator[]() [2/2]

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE RealConstT& axom::ArrayBase< T, 1, ArrayType >::operator[] ( const IndexType  idx) const
inline

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 , typename ArrayType >
AXOM_HOST_DEVICE T& axom::ArrayBase< T, 1, ArrayType >::flatIndex ( const IndexType  idx)
inline

Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data.

Parameters
[in]idxthe position of the value to return.
Note
equivalent to *(array.data() + idx).
Precondition
0 <= idx < m_num_elements

◆ flatIndex() [2/2]

template<typename T , typename ArrayType >
AXOM_HOST_DEVICE RealConstT& axom::ArrayBase< T, 1, ArrayType >::flatIndex ( const IndexType  idx) const
inline

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 , typename ArrayType >
void axom::ArrayBase< T, 1, ArrayType >::swap ( ArrayBase< T, 1, ArrayType > &  )
inline

Swaps two ArrayBases No member data, so this is a no-op.

◆ blockSize()

template<typename T , typename ArrayType >
IndexType axom::ArrayBase< T, 1, ArrayType >::blockSize ( ) const
inlineprotected

Returns the minimum "chunk size" that should be allocated.

◆ updateShapeOnInsert()

template<typename T , typename ArrayType >
void axom::ArrayBase< T, 1, ArrayType >::updateShapeOnInsert ( const StackArray< IndexType, 1 > &  )
inlineprotected

Updates the internal dimensions and striding based on the insertion of a range of elements. No-op, since we don't keep any shape information in this specialization.

References AXOM_HOST_DEVICE.


The documentation for this class was generated from the following file: