AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Provides a generic multi-component array, contained in Sidre. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/sidre/core/Array.hpp>
Public Types | |
using | value_type = T |
using | ArrayIterator = ArrayIteratorBase< Array< T, DIM, MemorySpace::Dynamic >, T > |
using | ConstArrayIterator = ArrayIteratorBase< const Array< T, DIM, MemorySpace::Dynamic >, const T > |
using | ArrayViewType = ArrayView< T, DIM, MemorySpace::Dynamic > |
using | ConstArrayViewType = ArrayView< const T, DIM, MemorySpace::Dynamic > |
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 |
Public Member Functions | |
Array ()=delete | |
Default constructor. Disabled. More... | |
Array (const Array &)=delete | |
Copy constructor. More... | |
Array (Array &&other) | |
Move constructor. More... | |
virtual | ~Array () |
Array & | operator= (const Array &)=delete |
Copy assignment. More... | |
Array & | operator= (Array &&other) |
Move assignment. More... | |
std::enable_if< TDIM==1, axom::StackArray< TT, LENGTH1D > >::type | to_stack_array () const |
Convert 1D Array into a StackArray. More... | |
Array< T, DIM, MemorySpace::Dynamic >::ArrayIterator | emplace (Array< T, DIM, MemorySpace::Dynamic >::ArrayIterator pos, Args &&... args) |
void | swap (ArrayBase &other) |
Swaps two ArrayBases. 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... | |
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... | |
Sidre Array constructors | |
template<int SFINAE = DIM, typename std::enable_if< SFINAE==1 >::type * = nullptr> | |
Array (View *view) | |
Creates an Array instance from a View that already has data. More... | |
template<int SFINAE = DIM, typename std::enable_if< SFINAE==2 >::type * = nullptr> | |
Array (View *view) | |
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 SFINAE = DIM, typename std::enable_if< SFINAE==1 >::type * = nullptr> | |
Array (View *view, axom::IndexType num_elements, axom::IndexType capacity=0) | |
Creates an Array instance of num_elements size and populates the associated View. More... | |
template<int SFINAE = DIM, typename std::enable_if< SFINAE==2 >::type * = nullptr> | |
Array (View *view, axom::IndexType num_tuples, axom::IndexType num_components=1, axom::IndexType capacity=0) | |
Creates an Array instance of num_tuples size, where each tuple consists of num_components values and populates the associated View. More... | |
Array methods to query and set attributes | |
virtual bool | isExternal () const |
Return true iff the external buffer constructor was called. More... | |
const View * | getView () const |
Return a pointer to the View that this Array wraps. More... | |
Array element access operators | |
T * | data () |
Return a pointer to the array of data. More... | |
const T * | data () const |
Array methods to modify the data. | |
void | fill (const T &value) |
Set all the values of the array. More... | |
void | fill (const T &value, IndexType n, IndexType pos) |
Set a range of elements to a given value. More... | |
void | set (const T *elements, IndexType n, IndexType pos) |
Modify the values of existing elements. More... | |
void | clear () |
Clears the contents of the array. More... | |
void | insert (IndexType pos, const T &value) |
Insert an element into the array at the given position. More... | |
ArrayIterator | insert (ArrayIterator pos, const T &value) |
Insert an element into the array at the value before pos. More... | |
void | insert (IndexType pos, IndexType n, const T *values) |
Insert elements into the array at the given position. More... | |
ArrayIterator | insert (ArrayIterator pos, IndexType n, const T *values) |
Insert elements into the array at the value before pos. More... | |
void | insert (IndexType pos, IndexType n, const T &value) |
Insert n copies of element into the array at the given position. More... | |
ArrayIterator | insert (ArrayIterator pos, IndexType n, const T &value) |
Insert n copies of element into the array at the value before pos. More... | |
void | insert (IndexType pos, ArrayView< const T, DIM, OtherSpace > other) |
Inserts an Array to the end of the calling object. More... | |
void | insert (IndexType pos, ArrayView< T, DIM, OtherSpace > other) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | append (ArrayView< const T, DIM, OtherSpace > other) |
Appends an Array to the end of the calling object. More... | |
void | append (ArrayView< T, DIM, OtherSpace > other) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
ArrayIterator | erase (ArrayIterator pos) |
Erases an element from the Array. More... | |
ArrayIterator | erase (ArrayIterator first, ArrayIterator last) |
Erases elements in the range [first, last) from the Array. More... | |
void | emplace (IndexType pos, Args &&... args) |
Inserts new element into Array at the given position. More... | |
ArrayIterator | emplace (ArrayIterator pos, Args &&... args) |
Inserts new element into Array before pos. More... | |
void | push_back (const T &value) |
Push a value to the back of the array. More... | |
void | push_back (T &&value) |
Push a value to the back of the array. More... | |
void | emplace_back (Args &&... args) |
Inserts new element at the end of the Array. More... | |
Array methods to query and set attributes | |
IndexType | capacity () const |
Return the number of elements allocated for the data array. More... | |
void | reserve (IndexType capacity) |
Increase the capacity. Does nothing if the new capacity is less than the current capacity. More... | |
ArrayIterator | begin () |
Returns an ArrayIterator to the first element of the Array. More... | |
ConstArrayIterator | begin () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
ArrayIterator | end () |
Returns an ArrayIterator to the element following the last element of the Array. More... | |
ConstArrayIterator | end () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
T & | front () |
Returns a reference to the first element in the Array. More... | |
const T & | front () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
T & | back () |
Returns a reference to the last element in the Array. More... | |
const T & | back () 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 | shrink () |
Shrink the capacity to be equal to the size. More... | |
bool | empty () const |
Returns true iff the Array stores no elements. More... | |
IndexType | size () const |
Return the number of elements stored in the data array. More... | |
void | resize (Args... args) |
Update the number of elements stored in the data array. More... | |
void | resize (ArrayOptions::Uninitialized, Args... args) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | resize (IndexType size, const T &value) |
void | resize (const StackArray< IndexType, DIM > &size, const T &value) |
void | swap (Array< T, DIM, MemorySpace::Dynamic > &other) |
Exchanges the contents of this Array with the other. More... | |
double | getResizeRatio () const |
Get the ratio by which the capacity increases upon dynamic resize. More... | |
void | setResizeRatio (double ratio) |
Set the ratio by which the capacity increases upon dynamic resize. More... | |
int | getAllocatorID () const |
Get the ID for the umpire allocator. More... | |
ArrayViewType | view () |
Returns a view of the array. More... | |
ConstArrayViewType | view () 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 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 | |
static constexpr double | DEFAULT_RESIZE_RATIO |
static constexpr IndexType | MIN_DEFAULT_CAPACITY |
static constexpr MemorySpace | space |
constexpr static int | Dims = DIM |
Protected Member Functions | |
virtual void | updateNumElements (axom::IndexType new_num_elements) |
Update the number of elements. More... | |
virtual void | setCapacity (axom::IndexType new_capacity) |
Set the number of elements allocated for the data array. More... | |
virtual void | dynamicRealloc (axom::IndexType new_num_elements) |
Reallocates the data array when the size exceeds the capacity. More... | |
void | describeView () |
Applies this Array's type and dimensions to the sidre View. More... | |
axom::IndexType | getViewShape (int dim) const |
Given a non-empty View of dimension 2, returns the length of the given dimension. More... | |
void | reallocViewData (IndexType new_capacity) |
Allocates space within the Array's View. More... | |
void | initialize (IndexType num_elements, IndexType capacity, bool should_default_construct=true) |
Initialize an Array instance with the given number of elements. More... | |
void | initialize_from_other (const T *data, IndexType num_elements, MemorySpace data_space, bool user_provided_allocator) |
Helper function for initializing an Array instance with an existing range of elements. More... | |
void | resizeImpl (const StackArray< IndexType, DIM > &dims, bool construct_with_values, const T *value=nullptr) |
Updates the number of elements stored in the data array. More... | |
T * | reserveForInsert (IndexType n, IndexType pos) |
Make space for a subsequent insertion into the array. More... | |
IndexType | reserveForDeviceInsert (IndexType n) |
Make space for a subsequent insertion into the array. More... | |
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... | |
Static Protected Member Functions | |
template<typename U = T> | |
static constexpr std::enable_if<!std::is_enum< U >::value, TypeID >::type | sidreTypeId () |
Return the TypeID corresponding to T. This function handles when T is not an enum. More... | |
template<typename U = T> | |
static constexpr std::enable_if< std::is_enum< U >::value, TypeID >::type | sidreTypeId () |
Return the TypeID corresponding to T. This function handles when T is an enum. More... | |
Protected Attributes | |
View * | m_view |
T * | m_data |
IndexType | m_num_elements |
The full number of elements in the array i.e., 3 for a 1D Array of size 3, 9 for a 3x3 2D array, etc. More... | |
IndexType | m_capacity |
double | m_resize_ratio |
int | m_allocator_id |
StackArray< IndexType, DIM > | m_shape |
The extent in each direction. More... | |
StackArray< IndexType, DIM > | m_strides |
Logical strides in each direction. More... | |
Provides a generic multi-component array, contained in Sidre.
This sidre::Array class extends axom::Array by storing data in a Sidre DataStore
. This class provides a generic multi-component array container with dynamic re-allocation and insertion. Each element in the array is a tuple consisting of 1 or more components, which are stored contiguously.
Objects of the sidre::Array class may be constructed from a View. All array operations can be performed as with the base axom::Array class. The size of the Array can grow as needed, and all memory management is delegated to Sidre.
reserve()
when the number of nodes is known a priori, or opt to use a constructor that takes an actual size and capacity when possible.T | the type of the values to hold. |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
delete |
Default constructor. Disabled.
|
delete |
Copy constructor.
Deleted because copies would have to reference the same underlying Sidre buffer, which does not match the underlying axom::Array ownership model
axom::sidre::Array< T, DIM >::Array | ( | Array< T, DIM > && | other | ) |
Move constructor.
[in] | other | The array to move from |
References axom::sidre::Array< T, DIM >::m_view.
axom::sidre::Array< T, DIM >::Array | ( | View * | view | ) |
Creates an Array instance from a View that already has data.
References axom::sidre::View::getBuffer(), axom::sidre::Buffer::getNumElements(), axom::sidre::View::getTypeID(), axom::sidre::Array< T, DIM >::getViewShape(), axom::sidre::View::getVoidPtr(), axom::sidre::View::isEmpty(), axom::Array< T, 1 >::m_capacity, axom::Array< T, 1 >::m_data, axom::Array< T, 1 >::m_num_elements, axom::sidre::Array< T, DIM >::m_view, axom::ArrayBase< T, DIM, ArrayType >::setShape(), axom::sidre::Array< T, DIM >::sidreTypeId(), and SLIC_ERROR_IF.
axom::sidre::Array< T, DIM >::Array | ( | View * | view | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
axom::sidre::Array< T, DIM >::Array | ( | View * | view, |
axom::IndexType | num_elements, | ||
axom::IndexType | capacity = 0 |
||
) |
Creates an Array instance of num_elements
size and populates the associated View.
[in] | view | the View that will hold this Array's data. |
[in] | num_elements | the number of values. |
[in] | capacity | the number of values to allocate space for. |
References axom::Array< T, 1 >::capacity(), axom::sidre::View::isEmpty(), axom::Array< T, 1 >::m_capacity, axom::Array< T, 1 >::m_data, axom::Array< T, 1 >::m_num_elements, axom::sidre::Array< T, DIM >::m_view, axom::sidre::Array< T, DIM >::reallocViewData(), SLIC_ASSERT, and SLIC_ERROR_IF.
axom::sidre::Array< T, DIM >::Array | ( | View * | view, |
axom::IndexType | num_tuples, | ||
axom::IndexType | num_components = 1 , |
||
axom::IndexType | capacity = 0 |
||
) |
Creates an Array instance of num_tuples
size, where each tuple consists of num_components
values and populates the associated View.
[in] | view | the View that will hold this Array's data. |
[in] | num_tuples | the number of tuples accounted for in the Array. |
[in] | num_components | the number of values per tuple. If not specified defaults to 1. |
[in] | capacity | the number of tuples to allocate space for. |
References axom::Array< T, 1 >::capacity(), axom::sidre::View::isEmpty(), axom::Array< T, 1 >::m_capacity, axom::Array< T, 1 >::m_data, axom::Array< T, 1 >::m_num_elements, axom::sidre::Array< T, DIM >::m_view, axom::sidre::Array< T, DIM >::reallocViewData(), SLIC_ASSERT, SLIC_ERROR_IF, and axom::ArrayBase< T, DIM, ArrayType >::updateStrides().
|
virtual |
Destructor. Frees the associated buffer unless owned by Sidre.
Reimplemented from axom::Array< T, 1 >.
|
delete |
Copy assignment.
Deleted because copies would have to reference the same underlying Sidre buffer, which does not match the underlying axom::Array ownership model
Array< T, DIM > & axom::sidre::Array< T, DIM >::operator= | ( | Array< T, DIM > && | other | ) |
Move assignment.
[in] | other | The Array to move from |
References axom::Array< T, DIM, SPACE >::operator=().
|
inlinevirtual |
Return true iff the external buffer constructor was called.
|
inline |
Return a pointer to the View that this Array wraps.
References axom::sidre::Array< T, DIM >::m_view.
|
inlineprotectedvirtual |
Update the number of elements.
[in] | new_num_elements | the new number of elements. |
Reimplemented from axom::Array< T, 1 >.
References SLIC_ASSERT.
|
inlineprotectedvirtual |
Set the number of elements allocated for the data array.
[in] | capacity | the new number of elements to allocate. |
Reimplemented from axom::Array< T, 1 >.
References SLIC_ASSERT.
|
inlineprotectedvirtual |
Reallocates the data array when the size exceeds the capacity.
[in] | new_num_elements | the number of elements which exceeds the current capacity. |
Reimplemented from axom::Array< T, 1 >.
References SLIC_ERROR_IF.
|
inlinestaticconstexprprotected |
Return the TypeID corresponding to T. This function handles when T is not an enum.
|
inlinestaticconstexprprotected |
Return the TypeID corresponding to T. This function handles when T is an enum.
|
inlineprotected |
Applies this Array's type and dimensions to the sidre View.
Calls m_view->apply(sidreTypeId(), 2, {m_num_tuples, m_num_components}).
References axom::sidre::detail::describeViewImpl().
|
inlineprotected |
|
inlineprotected |
Allocates space within the Array's View.
[in] | new_capacity | the number of elements to allocate. |
References SLIC_ERROR_IF.
|
inlineinherited |
Return a pointer to the array of data.
|
inlineinherited |
|
inlineinherited |
Convert 1D Array into a StackArray.
|
inlineinherited |
Set all the values of the array.
[in] | value | the value to set to. |
|
inlineinherited |
Set a range of elements to a given value.
[in] | value | the value to set to. |
[in] | n | the number of elements to write. |
[in] | pos | the position at which to begin writing. |
|
inlineinherited |
Modify the values of existing elements.
[in] | elements | the new elements to write. |
[in] | n | the number of elements to write. |
[in] | pos | the position at which to begin writing. |
|
inlineinherited |
Clears the contents of the array.
|
inlineinherited |
Insert an element into the array at the given position.
[in] | pos | the position at which to insert. |
[in] | value | the element value to insert. |
|
inherited |
Insert an element into the array at the value before pos.
[in] | pos | the ArrayIterator before which value will be inserted. |
[in] | value | the element value to insert. |
|
inlineinherited |
Insert elements into the array at the given position.
[in] | pos | the position at which to begin the insertion. |
[in] | n | the number of elements to insert. |
[in] | values | the element values to insert. |
|
inherited |
Insert elements into the array at the value before pos.
[in] | pos | the ArrayIterator before which value will be inserted. |
[in] | n | the number of elements to insert. |
[in] | values | the element values to insert. |
|
inlineinherited |
Insert n copies of element into the array at the given position.
[in] | pos | the position at which to begin the insertion. |
[in] | n | the number of elements to insert. |
[in] | value | the element value to insert. |
|
inherited |
Insert n copies of element into the array at the value before pos.
[in] | pos | the ArrayIterator before which value will be inserted. |
[in] | n | the number of elements to insert. |
[in] | value | the element value to insert. |
|
inlineinherited |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inherited |
|
inherited |
Erases elements in the range [first, last) from the Array.
[in] | first | the ArrayIterator to the beginning of the range. |
[in] | last | the ArrayIterator to end of range. |
|
inlineinherited |
Inserts new element into Array at the given position.
[in] | pos | the position to insert element at. |
[in] | args | the arguments to forward to constructor of the element. |
|
inherited |
Inserts new element into Array before pos.
[in] | pos | the ArrayIterator to insert element before. |
[in] | args | the arguments to forward to constructor of the element. |
|
inlineinherited |
|
inlineinherited |
Push a value to the back of the array.
[in] | value | the value to be added to the back. |
|
inlineinherited |
Push a value to the back of the array.
[in] | value | the value to move to the back. |
|
inlineinherited |
Inserts new element at the end of the Array.
[in] | args | the arguments to forward to constructor of the element. |
|
inlineinherited |
Return the number of elements allocated for the data array.
|
inlineinherited |
Increase the capacity. Does nothing if the new capacity is less than the current capacity.
[in] | capacity | the new number of elements to allocate. |
|
inlineinherited |
Returns an ArrayIterator to the first element of the Array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Returns an ArrayIterator to the element following the last element of the Array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Returns a reference to the first element in the Array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Returns a reference to the last element in the Array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Shrink the capacity to be equal to the size.
|
inlineinherited |
|
inlineinherited |
Return the number of elements stored in the data array.
|
inlineinherited |
Update the number of elements stored in the data array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Exchanges the contents of this Array with the other.
|
inlineinherited |
Swaps two ArrayBases.
References axom::ArrayBase< T, DIM, ArrayType >::m_shape, axom::ArrayBase< T, DIM, ArrayType >::m_strides, and axom::utilities::swap().
|
inlineinherited |
Get the ratio by which the capacity increases upon dynamic resize.
|
inlineinherited |
Set the ratio by which the capacity increases upon dynamic resize.
[in] | ratio | the new resize ratio. |
|
inlineinherited |
Get the ID for the umpire allocator.
|
inlineinherited |
Returns a view of the array.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineprotectedinherited |
Initialize an Array instance with the given number of elements.
[in] | num_elements | the number of elements the Array holds. |
[in] | capacity | the number of elements to allocate space for. |
[in] | should_default_construct | whether to create default-constructed objects in the region [0, num_elements). Defaults to true. |
|
inlineprotectedinherited |
Helper function for initializing an Array instance with an existing range of elements.
[in] | data | pointer to the existing array of elements |
[in] | num_elements | the number of elements in the existing array |
[in] | data_space | the memory space in which data has been allocated |
[in] | user_provided_allocator | true if the Array's allocator ID was provided by the user |
|
inlineprotectedinherited |
Updates the number of elements stored in the data array.
[in] | dims | the number of elements to allocate in each dimension |
[in] | construct_with_values | if true, sets new elements in the array to a specified value |
[in] | value | pointer to the value to fill new elements in the array with. If null, will default-construct elements in place. |
|
inlineprotectedinherited |
Make space for a subsequent insertion into the array.
[in] | n | the number of elements to insert. |
[in] | pos | the position at which to begin the insertion. |
|
inlineprotectedinherited |
Make space for a subsequent insertion into the array.
[in] | n | the number of elements to insert. |
|
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 |
Returns the dimensions of the Array.
References axom::ArrayBase< T, DIM, ArrayType >::m_shape.
|
inlineinherited |
Returns the memory strides of the Array.
References axom::ArrayBase< T, DIM, ArrayType >::m_strides.
|
inlineinherited |
Returns the minimum stride between adjacent items.
References axom::ArrayBase< T, DIM, ArrayType >::m_strides, and axom::utilities::min().
|
inlineprotectedinherited |
Set the shape.
References axom::ArrayBase< T, DIM, ArrayType >::m_shape, and axom::ArrayBase< T, DIM, ArrayType >::updateStrides().
|
inlineprotectedinherited |
Set the shape and stride.
References axom::ArrayBase< T, DIM, ArrayType >::m_shape, axom::ArrayBase< T, DIM, ArrayType >::m_strides, and axom::ArrayBase< T, DIM, ArrayType >::shape().
|
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.
References axom::ArrayBase< T, DIM, ArrayType >::m_strides.
|
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.
References axom::ArrayBase< T, DIM, ArrayType >::m_shape, and axom::ArrayBase< T, DIM, ArrayType >::m_strides.
|
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.
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().
|
protected |
|
staticconstexprinherited |
|
staticconstexprinherited |
|
staticconstexprinherited |
|
protectedinherited |
|
protectedinherited |
The full number of elements in the array i.e., 3 for a 1D Array of size 3, 9 for a 3x3 2D array, etc.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticconstexprinherited |
|
protectedinherited |
The extent in each direction.
|
protectedinherited |
Logical strides in each direction.