GEOSX
Public Types | Protected Types | Protected Member Functions | Protected Attributes | List of all members
LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > Class Template Reference

This class provides a view into an array of arrays like object. More...

#include <ArrayOfArraysView.hpp>

Inheritance diagram for LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >:
Inheritance graph
[legend]

Public Types

using ValueType = T
 An alias for the type contained in the inner arrays.
 
using IndexType = INDEX_TYPE
 The integer type used for indexing.
 
using value_type = T
 An alias for the type contained in the inner arrays, here for stl compatability.
 
using size_type = INDEX_TYPE
 The integer type used for indexing, here for stl compatability.
 

Public Member Functions

Constructors, destructor and assignment operators
 ArrayOfArraysView ()=default
 A constructor to create an uninitialized ArrayOfArraysView. More...
 
 ArrayOfArraysView (ArrayOfArraysView const &)=default
 Default copy constructor. More...
 
constexpr ArrayOfArraysView (ArrayOfArraysView &&src)
 Default move constructor. More...
 
constexpr ArrayOfArraysView (INDEX_TYPE const numArrays, BUFFER_TYPE< INDEX_TYPE > const &offsets, BUFFER_TYPE< SIZE_TYPE > const &sizes, BUFFER_TYPE< T > const &values)
 Construct a new ArrayOfArraysView from the given buffers. More...
 
ArrayOfArraysViewoperator= (ArrayOfArraysView const &)=default
 Default copy assignment operator. More...
 
ArrayOfArraysViewoperator= (ArrayOfArraysView &&src)
 Move assignment operator.. More...
 
ArrayOfArraysView creation methods
constexpr ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, BUFFER_TYPE > toView () const
 
constexpr ArrayOfArraysView< T, INDEX_TYPE const, true, BUFFER_TYPE > toViewConstSizes () const
 
constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > toViewConst () const
 
Attribute querying methods
constexpr INDEX_TYPE_NC size () const
 
constexpr INDEX_TYPE_NC sizeOfArray (INDEX_TYPE const i) const
 
constexpr SIZE_TYPE const * getSizes () const
 
constexpr INDEX_TYPE const * getOffsets () const
 
constexpr T const * getValues () const
 
CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC capacity () const
 
constexpr INDEX_TYPE_NC capacityOfArray (INDEX_TYPE const i) const
 
constexpr INDEX_TYPE_NC valueCapacity () const
 
Methods that provide access to the data
constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NCoperator[] (INDEX_TYPE const i) const
 
constexpr T & operator() (INDEX_TYPE const i, INDEX_TYPE const j) const
 
Methods that modify the size of an inner array.
template<typename ... ARGS>
void emplaceBack (INDEX_TYPE const i, ARGS &&... args) const
 Append a value to an array. More...
 
template<typename POLICY , typename ... ARGS>
void emplaceBackAtomic (INDEX_TYPE const i, ARGS &&... args) const
 Append a value to an array in a thread safe manner. More...
 
template<typename ITER >
void appendToArray (INDEX_TYPE const i, ITER const first, ITER const last) const
 Append values to an array. More...
 
template<typename ... ARGS>
void emplace (INDEX_TYPE const i, INDEX_TYPE const j, ARGS &&... args) const
 Insert a value into an array. More...
 
template<typename ITER >
void insertIntoArray (INDEX_TYPE const i, INDEX_TYPE const j, ITER const first, ITER const last) const
 Insert values into an array. More...
 
void eraseFromArray (INDEX_TYPE const i, INDEX_TYPE const j, INDEX_TYPE const n=1) const
 Erase values from an array. More...
 
Methods dealing with memory spaces
void registerTouch (MemorySpace const space) const
 Touch the memory in space. More...
 
void move (MemorySpace const space, bool touch=true) const
 Move this ArrayOfArrays to the given memory space. More...
 

Protected Types

using INDEX_TYPE_NC = std::remove_const_t< INDEX_TYPE >
 Since INDEX_TYPE should always be const we need an alias for the non const version.
 
using SIZE_TYPE = std::conditional_t< CONST_SIZES, INDEX_TYPE const, INDEX_TYPE_NC >
 The type contained by the m_sizes buffer.
 
template<typename U >
using PairOfBuffers = std::pair< BUFFER_TYPE< U > &, BUFFER_TYPE< U > const &>
 Alias for a std::pair of buffers. More...
 

Protected Member Functions

 ArrayOfArraysView (bool)
 Protected constructor to be used by parent classes. More...
 
Methods intended to be publically aliased directly in a derived array class.
void resize (INDEX_TYPE const newSize, INDEX_TYPE const defaultArrayCapacity=0)
 Set the number of arrays. More...
 
void reserve (INDEX_TYPE const newCapacity)
 Reserve space for the given number of arrays. More...
 
template<class ... BUFFERS>
void reserveValues (INDEX_TYPE const newValueCapacity, BUFFERS &... buffers)
 Reserve space for the given number of values. More...
 
template<class ... BUFFERS>
void compress (BUFFERS &... buffers)
 Compress the arrays so that the values of each array are contiguous with no extra capacity in between. More...
 
template<typename POLICY , typename ... BUFFERS>
void resizeFromCapacities (INDEX_TYPE const numSubArrays, INDEX_TYPE const *const capacities, BUFFERS &... buffers)
 Clears the array and creates a new array with the given number of sub-arrays. More...
 
Methods to be used to help implement a derived classes
void assimilate (ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&src)
 Steal the resources of src, clearing it in the process. More...
 
template<typename ... BUFFERS>
void resizeImpl (INDEX_TYPE const newSize, INDEX_TYPE const defaultArrayCapacity, BUFFERS &... buffers)
 Set the number of arrays. More...
 
template<class ... BUFFERS>
void free (BUFFERS &... buffers)
 Destroy all the objects held by this array and free all associated memory. More...
 
template<class ... PAIRS_OF_BUFFERS>
void setEqualTo (INDEX_TYPE const srcNumArrays, INDEX_TYPE const srcMaxOffset, BUFFER_TYPE< INDEX_TYPE > const &srcOffsets, BUFFER_TYPE< INDEX_TYPE > const &srcSizes, BUFFER_TYPE< T > const &srcValues, PAIRS_OF_BUFFERS &&... pairs)
 Set this ArrayOfArraysView equal to the provided arrays. More...
 
template<class ... BUFFERS>
void setCapacityOfArray (INDEX_TYPE const i, INDEX_TYPE const newCapacity, BUFFERS &... buffers)
 Set the capacity of the given array. More...
 
template<typename U >
void setName (std::string const &name)
 Set the name to be displayed whenever the underlying Buffer's user call back is called. More...
 

Protected Attributes

INDEX_TYPE_NC m_numArrays = 0
 The number of arrays contained.
 
BUFFER_TYPE< INDEX_TYPE > m_offsets
 
BUFFER_TYPE< SIZE_TYPEm_sizes
 Holds the size of each array.
 
BUFFER_TYPE< T > m_values
 

Detailed Description

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
class LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >

This class provides a view into an array of arrays like object.

Template Parameters
Tthe type stored in the arrays.
INDEX_TYPEthe integer to use for indexing.
CONST_SIZEStrue iff the size of each array is constant.

When INDEX_TYPE is const m_offsets is not copied between memory spaces. When accessing this class directly (not through an ArrayOfArrays object) INDEX_TYPE should always be const since ArrayOfArraysView is not allowed to modify the offsets.

When CONST_SIZES is true m_sizes is not copied between memory spaces.

Definition at line 168 of file ArrayOfArraysView.hpp.

Member Typedef Documentation

◆ PairOfBuffers

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename U >
using LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::PairOfBuffers = std::pair< BUFFER_TYPE< U > &, BUFFER_TYPE< U > const & >
protected

Alias for a std::pair of buffers.

Template Parameters
UThe type contained in the buffers.

Definition at line 602 of file ArrayOfArraysView.hpp.

Constructor & Destructor Documentation

◆ ArrayOfArraysView() [1/5]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::ArrayOfArraysView ( )
default

A constructor to create an uninitialized ArrayOfArraysView.

Note
An uninitialized ArrayOfArraysView should not be used until it is assigned to.

◆ ArrayOfArraysView() [2/5]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::ArrayOfArraysView ( ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > const &  )
default

Default copy constructor.

Note
The copy constructor will trigger the copy constructor for
Template Parameters
BUFFER_TYPE

◆ ArrayOfArraysView() [3/5]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::ArrayOfArraysView ( ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&  src)
inline

Default move constructor.

Parameters
srcthe ArrayOfArraysView to be moved from.

Definition at line 216 of file ArrayOfArraysView.hpp.

◆ ArrayOfArraysView() [4/5]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::ArrayOfArraysView ( INDEX_TYPE const  numArrays,
BUFFER_TYPE< INDEX_TYPE > const &  offsets,
BUFFER_TYPE< SIZE_TYPE > const &  sizes,
BUFFER_TYPE< T > const &  values 
)
inline

Construct a new ArrayOfArraysView from the given buffers.

Parameters
numArraysThe number of arrays.
offsetsThe offsets buffer, of size numArrays + 1.
sizesThe sizes buffer, of size numArrays.
valuesThe values buffer, of size offsets[ numArrays ].

Definition at line 231 of file ArrayOfArraysView.hpp.

◆ ArrayOfArraysView() [5/5]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::ArrayOfArraysView ( bool  )
inlineprotected

Protected constructor to be used by parent classes.

Note
The unused boolean parameter is to distinguish this from the default constructor.

Definition at line 608 of file ArrayOfArraysView.hpp.

Member Function Documentation

◆ appendToArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ITER >
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::appendToArray ( INDEX_TYPE const  i,
ITER const  first,
ITER const  last 
) const
inline

Append values to an array.

Template Parameters
ITERAn iterator, they type of first and last.
Parameters
ithe array to append to.
firstAn iterator to the first value to append.
lastAn iterator to the end of the values to append.
Precondition
Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.

Definition at line 484 of file ArrayOfArraysView.hpp.

◆ assimilate()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::assimilate ( ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&  src)
inlineprotected

Steal the resources of src, clearing it in the process.

Parameters
srcThe ArrayOfArraysView to steal from.

Definition at line 748 of file ArrayOfArraysView.hpp.

◆ capacity()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::capacity ( ) const
inline
Returns
Return the number of (zero length) arrays that can be stored before reallocation.

Definition at line 370 of file ArrayOfArraysView.hpp.

◆ capacityOfArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr INDEX_TYPE_NC LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::capacityOfArray ( INDEX_TYPE const  i) const
inline
Returns
Return the capacity of the given array.
Parameters
ithe array to query.

Definition at line 381 of file ArrayOfArraysView.hpp.

◆ compress()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::compress ( BUFFERS &...  buffers)
inlineprotected

Compress the arrays so that the values of each array are contiguous with no extra capacity in between.

Template Parameters
BUFFERSvariadic template where each type is a BUFFER_TYPE.
Parameters
buffersvariadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values.
Note
This method doesn't free any memory.

Definition at line 663 of file ArrayOfArraysView.hpp.

◆ emplace()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplace ( INDEX_TYPE const  i,
INDEX_TYPE const  j,
ARGS &&...  args 
) const
inline

Insert a value into an array.

Template Parameters
ARGSA variadic pack of types used to construct the new T, the types of args.
Parameters
ithe array to insert into.
jthe position at which to insert.
argsThe variadic pack of arguments forwared to construct the new value.
Precondition
Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.

Definition at line 505 of file ArrayOfArraysView.hpp.

◆ emplaceBack()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplaceBack ( INDEX_TYPE const  i,
ARGS &&...  args 
) const
inline

Append a value to an array.

Template Parameters
ARGSA variadic pack of types used to construct the new T, the types of args.
Parameters
ithe array to append to.
argsThe variadic pack of arguments forwared to construct the new value.
Precondition
Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.

Definition at line 441 of file ArrayOfArraysView.hpp.

◆ emplaceBackAtomic()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename POLICY , typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplaceBackAtomic ( INDEX_TYPE const  i,
ARGS &&...  args 
) const
inline

Append a value to an array in a thread safe manner.

Template Parameters
POLICYThe RAJA atomic policy to use to increment the size of the array.
ARGSA variadic pack of types used to construct the new T, the types of args.
Parameters
ithe array to append to.
argsThe variadic pack of arguments forwared to construct the new value.
Precondition
Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.

Definition at line 462 of file ArrayOfArraysView.hpp.

◆ eraseFromArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::eraseFromArray ( INDEX_TYPE const  i,
INDEX_TYPE const  j,
INDEX_TYPE const  n = 1 
) const
inline

Erase values from an array.

Parameters
ithe array to erase values from.
jthe position at which to begin erasing.
nthe number of values to erase.

Definition at line 548 of file ArrayOfArraysView.hpp.

◆ free()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::free ( BUFFERS &...  buffers)
inlineprotected

Destroy all the objects held by this array and free all associated memory.

Template Parameters
BUFFERSvariadic template where each type is a BUFFER_TYPE.
Parameters
buffersvariadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values.

Definition at line 805 of file ArrayOfArraysView.hpp.

◆ getOffsets()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr INDEX_TYPE const* LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::getOffsets ( ) const
inline
Returns
Return a pointer to the value array offsets for each outer array with an entry for the end of the values.

Definition at line 350 of file ArrayOfArraysView.hpp.

◆ getSizes()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr SIZE_TYPE const* LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::getSizes ( ) const
inline
Returns
Return a pointer to the sizes of each outer array.

Definition at line 339 of file ArrayOfArraysView.hpp.

◆ getValues()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr T const* LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::getValues ( ) const
inline
Returns
Return a pointer to the values data.

Definition at line 359 of file ArrayOfArraysView.hpp.

◆ insertIntoArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ITER >
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::insertIntoArray ( INDEX_TYPE const  i,
INDEX_TYPE const  j,
ITER const  first,
ITER const  last 
) const
inline

Insert values into an array.

Template Parameters
ITERAn iterator, they type of first and last.
Parameters
ithe array to insert into.
jthe position at which to insert.
firstAn iterator to the first value to insert.
lastAn iterator to the end of the values to insert.
Precondition
Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.

Definition at line 527 of file ArrayOfArraysView.hpp.

◆ move()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::move ( MemorySpace const  space,
bool  touch = true 
) const
inline

Move this ArrayOfArrays to the given memory space.

Parameters
spaceThe memory space to move to.
touchIf true touch the values, sizes and offsets in the new space.
Note
When moving to the GPU since the offsets can't be modified on device they are not touched.

Definition at line 581 of file ArrayOfArraysView.hpp.

◆ operator()()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr T& LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::operator() ( INDEX_TYPE const  i,
INDEX_TYPE const  j 
) const
inline
Returns
Return a reference to the value at the given position in the given array.
Parameters
ithe array to access.
jthe index within the array to access.

Definition at line 418 of file ArrayOfArraysView.hpp.

◆ operator=() [1/2]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
ArrayOfArraysView& LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::operator= ( ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > const &  )
inlinedefault

Default copy assignment operator.

Returns
*this.

◆ operator=() [2/2]

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
ArrayOfArraysView& LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::operator= ( ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&  src)
inline

Move assignment operator..

Parameters
srcthe SparsityPatternView to be moved from.
Returns
*this.

Definition at line 254 of file ArrayOfArraysView.hpp.

◆ operator[]()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::operator[] ( INDEX_TYPE const  i) const
inline
Returns
Return an ArraySlice1d to the values of the given array.
Parameters
ithe array to access.

Definition at line 406 of file ArrayOfArraysView.hpp.

◆ registerTouch()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::registerTouch ( MemorySpace const  space) const
inline

Touch the memory in space.

Parameters
spaceThe memory space in which a touch will be recorded.

Definition at line 568 of file ArrayOfArraysView.hpp.

◆ reserve()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::reserve ( INDEX_TYPE const  newCapacity)
inlineprotected

Reserve space for the given number of arrays.

Parameters
newCapacitythe new minimum capacity for the number of arrays.

Definition at line 632 of file ArrayOfArraysView.hpp.

◆ reserveValues()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::reserveValues ( INDEX_TYPE const  newValueCapacity,
BUFFERS &...  buffers 
)
inlineprotected

Reserve space for the given number of values.

Template Parameters
BUFFERSvariadic template where each type is a BUFFER_TYPE.
Parameters
newValueCapacitythe new minimum capacity for the number of values across all arrays.
buffersvariadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values.

Definition at line 646 of file ArrayOfArraysView.hpp.

◆ resize()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resize ( INDEX_TYPE const  newSize,
INDEX_TYPE const  defaultArrayCapacity = 0 
)
inlineprotected

Set the number of arrays.

Parameters
newSizethe new number of arrays.
defaultArrayCapacitythe default capacity for each new array.

Definition at line 625 of file ArrayOfArraysView.hpp.

◆ resizeFromCapacities()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename POLICY , typename ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resizeFromCapacities ( INDEX_TYPE const  numSubArrays,
INDEX_TYPE const *const  capacities,
BUFFERS &...  buffers 
)
inlineprotected

Clears the array and creates a new array with the given number of sub-arrays.

Template Parameters
POLICYThe RAJA policy used to convert capacities into the offsets array. Should NOT be a device policy.
Parameters
numSubArraysThe new number of arrays.
capacitiesA pointer to an array of length numSubArrays containing the capacity of each new sub array.
buffersA variadic pack of buffers to treat similarly to m_values.

Definition at line 698 of file ArrayOfArraysView.hpp.

◆ resizeImpl()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resizeImpl ( INDEX_TYPE const  newSize,
INDEX_TYPE const  defaultArrayCapacity,
BUFFERS &...  buffers 
)
inlineprotected

Set the number of arrays.

Parameters
newSizethe new number of arrays.
defaultArrayCapacitythe default capacity for each new array.
Template Parameters
BUFFERSvariadic template where each type is BUFFER_TYPE.
Parameters
buffersvariadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values.

Definition at line 758 of file ArrayOfArraysView.hpp.

◆ setCapacityOfArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::setCapacityOfArray ( INDEX_TYPE const  i,
INDEX_TYPE const  newCapacity,
BUFFERS &...  buffers 
)
inlineprotected

Set the capacity of the given array.

Template Parameters
BUFFERSvariadic template where each type is a BUFFER_TYPE.
Parameters
ithe array to set the capacity of.
newCapacitythe value to set the capacity of the given array to.
buffersvariadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values.

Definition at line 876 of file ArrayOfArraysView.hpp.

◆ setEqualTo()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... PAIRS_OF_BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::setEqualTo ( INDEX_TYPE const  srcNumArrays,
INDEX_TYPE const  srcMaxOffset,
BUFFER_TYPE< INDEX_TYPE > const &  srcOffsets,
BUFFER_TYPE< INDEX_TYPE > const &  srcSizes,
BUFFER_TYPE< T > const &  srcValues,
PAIRS_OF_BUFFERS &&...  pairs 
)
inlineprotected

Set this ArrayOfArraysView equal to the provided arrays.

Template Parameters
PAIRS_OF_BUFFERSvariadic template where each type is an PairOfBuffers.
Parameters
srcNumArraysThe number of arrays in source.
srcMaxOffsetThe maximum offset in the source.
srcOffsetsthe source offsets array.
srcSizesthe source sizes array.
srcValuesthe source values array.
pairsvariadic parameter pack where each argument is an PairOfBuffers where each pair should be treated similarly to {m_values, srcValues}.

Definition at line 829 of file ArrayOfArraysView.hpp.

◆ setName()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename U >
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::setName ( std::string const &  name)
inlineprotected

Set the name to be displayed whenever the underlying Buffer's user call back is called.

Template Parameters
UThey type of the owning object.
Parameters
namethe name to display.

Definition at line 950 of file ArrayOfArraysView.hpp.

◆ size()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr INDEX_TYPE_NC LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::size ( ) const
inline
Returns
Return the number of arrays.

Definition at line 321 of file ArrayOfArraysView.hpp.

◆ sizeOfArray()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr INDEX_TYPE_NC LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::sizeOfArray ( INDEX_TYPE const  i) const
inline
Returns
Return the size of the given array.
Parameters
ithe array to query.

Definition at line 329 of file ArrayOfArraysView.hpp.

◆ toView()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, BUFFER_TYPE > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::toView ( ) const
inline
Returns
Return a new ArrayOfArraysView<T, INDEX_TYPE const, CONST_SIZES>.

Definition at line 276 of file ArrayOfArraysView.hpp.

◆ toViewConst()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::toViewConst ( ) const
inline
Returns
Return a new ArrayOfArraysView<T const, INDEX_TYPE const, true>.

Definition at line 302 of file ArrayOfArraysView.hpp.

◆ toViewConstSizes()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr ArrayOfArraysView< T, INDEX_TYPE const, true, BUFFER_TYPE > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::toViewConstSizes ( ) const
inline
Returns
Return a new ArrayOfArraysView<T, INDEX_TYPE const, true>.

Definition at line 289 of file ArrayOfArraysView.hpp.

◆ valueCapacity()

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
constexpr INDEX_TYPE_NC LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::valueCapacity ( ) const
inline
Returns
Return the total number values that can be stored before reallocation.

Definition at line 391 of file ArrayOfArraysView.hpp.

Member Data Documentation

◆ m_offsets

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
BUFFER_TYPE< INDEX_TYPE > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::m_offsets
protected

Holds the offset of each array, of length m_numArrays + 1. Array i begins at m_offsets[ i ] and has capacity m_offsets[i+1] - m_offsets[ i ].

Definition at line 964 of file ArrayOfArraysView.hpp.

◆ m_values

template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
BUFFER_TYPE< T > LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::m_values
protected

Holds the values of each array. Values in the range [m_offsets[ i ], m_offsets[ i ] + m_sizes[ i ]) are valid. All other entries contain uninitialized values.

Definition at line 971 of file ArrayOfArraysView.hpp.


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