39 template<
typename >
class BUFFER_TYPE >
91 BUFFER_TYPE< INDEX_TYPE >
const & offsets,
92 BUFFER_TYPE< SIZE_TYPE >
const & sizes,
93 BUFFER_TYPE< T >
const & values ):
192 bool contains( INDEX_TYPE
const i, T
const & value )
const 196 INDEX_TYPE
const setSize =
sizeOfSet( i );
197 T
const *
const setValues = (*this)[ i ];
209 INDEX_TYPE
const numSets =
size();
215 INDEX_TYPE
const numValues =
sizeOfSet( i );
217 "Values should be sorted and unique!" );
242 T
const &
operator()( INDEX_TYPE
const i, INDEX_TYPE
const j )
const 275 template<
typename ITER >
299 template<
typename ITER >
362 template<
typename CALLBACKS >
368 INDEX_TYPE
const setSize =
sizeOfSet( i );
387 template<
typename ITER,
typename CALLBACKS >
392 CALLBACKS && cbacks )
const 396 INDEX_TYPE
const setSize =
sizeOfSet( i );
403 std::forward< CALLBACKS >( cbacks ) );
416 template<
typename CALLBACKS >
422 INDEX_TYPE
const setSize =
sizeOfSet( i );
441 template<
typename ITER,
typename CALLBACKS >
446 CALLBACKS && cbacks )
const 450 INDEX_TYPE
const setSize =
sizeOfSet( i );
457 std::forward< CALLBACKS >( cbacks ) );
497 #ifdef LVARRAY_BOUNDS_CHECK 499 "ArrayOfSetsView cannot do reallocation." );
#define LVARRAY_UNUSED_VARIABLE(X)
Mark X as an unused variable, used to silence compiler warnings.
Definition: Macros.hpp:79
LVARRAY_HOST_DEVICE constexpr T const & operator()(INDEX_TYPE const i, INDEX_TYPE const j) const
Definition: ArrayOfSetsView.hpp:242
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK ArraySlice< T, 1, 0, INDEX_TYPE_NC > operator[](INDEX_TYPE const i) const
Definition: ArrayOfArraysView.hpp:409
#define ARRAYOFARRAYS_CHECK_BOUNDS(i)
Check that i is a valid array index.
Definition: ArrayOfArraysView.hpp:106
INDEX_TYPE size_type
The integer type used for indexing, here for stl compatability.
Definition: ArrayOfArraysView.hpp:194
LVARRAY_HOST_DEVICE T * incrementSize(T *const curPtr, INDEX_TYPE const nToAdd) const
Callback signaling that the size of the set has increased.
Definition: ArrayOfSetsView.hpp:494
#define LVARRAY_ERROR_IF(EXP, MSG)
Abort execution if EXP is true.
Definition: Macros.hpp:155
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
Definition: ArraySlice.hpp:89
INDEX_TYPE IndexType
The integer type used for indexing.
Definition: ArrayOfArraysView.hpp:188
LVARRAY_HOST_DEVICE INDEX_TYPE_NC removeFromSet(INDEX_TYPE const i, ITER const first, ITER const last) const
Removes multiple values from the given set.
Definition: ArrayOfSetsView.hpp:301
BUFFER_TYPE< INDEX_TYPE > m_offsets
Definition: ArrayOfArraysView.hpp:965
LVARRAY_HOST_DEVICE constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > getSetValues(INDEX_TYPE const i) const
Definition: ArrayOfSetsView.hpp:346
LVARRAY_HOST_DEVICE CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC capacity() const
Definition: ArrayOfArraysView.hpp:373
BUFFER_TYPE< T > m_values
Definition: ArrayOfArraysView.hpp:972
void move(MemorySpace const space, bool touch=true) const
Move this ArrayOfArrays to the given memory space.
Definition: ArrayOfArraysView.hpp:584
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE bool remove(T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, T const &value, CALLBACKS &&callBacks)
Remove the given value from the array if it exists.
Definition: sortedArrayManipulation.hpp:473
LVARRAY_HOST_DEVICE INDEX_TYPE_NC insertIntoSetImpl(INDEX_TYPE const i, ITER const first, ITER const last, CALLBACKS &&cbacks) const
Inserts multiple values into the given set.
Definition: ArrayOfSetsView.hpp:389
Contains templates useful for type manipulation.
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC capacityOfSet(INDEX_TYPE const i) const
Definition: ArrayOfSetsView.hpp:181
BUFFER_TYPE< SIZE_TYPE > m_sizes
Holds the size of each array.
Definition: ArrayOfArraysView.hpp:968
LVARRAY_HOST_DEVICE bool insertIntoSet(INDEX_TYPE const i, T const &value) const
Insert a value into the given set.
Definition: ArrayOfSetsView.hpp:261
LVARRAY_HOST_DEVICE constexpr T const * getValues() const
Definition: ArrayOfArraysView.hpp:362
LVARRAY_HOST_DEVICE INDEX_TYPE_NC insertIntoSet(INDEX_TYPE const i, ITER const first, ITER const last) const
Inserts multiple values into the given set.
Definition: ArrayOfSetsView.hpp:277
T value_type
An alias for the type contained in the inner arrays, here for stl compatability.
Definition: ArrayOfArraysView.hpp:191
LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, 1, 0, INDEX_TYPE_NC > operator[](INDEX_TYPE const i) const
Definition: ArrayOfSetsView.hpp:233
This class provides the callbacks for the sortedArrayManipulation routines.
Definition: ArrayOfSetsView.hpp:470
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > toArrayOfArraysView() const
Definition: ArrayOfSetsView.hpp:149
LVARRAY_HOST_DEVICE bool removeFromSet(INDEX_TYPE const i, T const &value) const
Remove a value from the given set.
Definition: ArrayOfSetsView.hpp:287
Contains the implementation of LvArray::ArraySlice.
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView(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.
Definition: ArrayOfSetsView.hpp:90
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView< T, INDEX_TYPE const, BUFFER_TYPE > toView() const
Definition: ArrayOfSetsView.hpp:123
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T & operator()(INDEX_TYPE const i, INDEX_TYPE const j) const
Definition: ArrayOfArraysView.hpp:421
ArrayOfSetsView const & m_aos
The ArrayOfSetsView the call back is associated with.
Definition: ArrayOfSetsView.hpp:508
#define LVARRAY_ERROR_IF_GT(lhs, rhs)
Raise a hard error if one value compares greater than the other.
Definition: Macros.hpp:392
This class provides a no-op callbacks interface for the ArrayManipulation sorted routines.
Definition: sortedArrayManipulation.hpp:72
This class provides a view into an array of sets like object.
Definition: ArrayOfSetsView.hpp:40
This class provides a view into an array of arrays like object.
Definition: ArrayOfArraysView.hpp:170
INDEX_TYPE const m_indexOfSet
The index of the set the call back is associated with.
Definition: ArrayOfSetsView.hpp:511
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC valueCapacity() const
Definition: ArrayOfArraysView.hpp:394
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC sizeOfArray(INDEX_TYPE const i) const
Definition: ArrayOfArraysView.hpp:332
void move(MemorySpace const space, bool const touch=true) const
Move this ArrayOfSets to the given memory space.
Definition: ArrayOfSetsView.hpp:320
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE bool isSortedUnique(ITER first, ITER const last, Compare &&comp=Compare())
Definition: sortedArrayManipulation.hpp:374
camp::resources::Platform MemorySpace
an alias for camp::resources::Platform.
Definition: bufferManipulation.hpp:31
LVARRAY_HOST_DEVICE bool contains(INDEX_TYPE const i, T const &value) const
Definition: ArrayOfSetsView.hpp:192
Contains functions for manipulating a contiguous array of values.
#define LVARRAY_DEBUG_VAR(X)
Mark X as an debug variable, used to silence compiler warnings.
Definition: Macros.hpp:85
LVARRAY_HOST_DEVICE bool removeFromSetImpl(INDEX_TYPE const i, T const &value, CALLBACKS &&cbacks) const
Helper function to remove a value from the given set.
Definition: ArrayOfSetsView.hpp:418
The top level namespace.
Definition: Array.hpp:24
#define LVARRAY_ERROR_IF_GT_MSG(lhs, rhs, msg)
Raise a hard error if one value compares greater than the other.
Definition: Macros.hpp:376
LVARRAY_HOST_DEVICE CallBacks(ArrayOfSetsView const &aos, INDEX_TYPE const i)
Constructor.
Definition: ArrayOfSetsView.hpp:480
Contains the implementation of LvArray::ArrayOfArraysView.
This file contains common sorted array manipulation routines. Aside from the functions that take a ca...
ArrayOfSetsView(bool)
Protected constructor to be used by parent classes.
Definition: ArrayOfSetsView.hpp:336
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView< T const, INDEX_TYPE const, BUFFER_TYPE > toViewConst() const
Definition: ArrayOfSetsView.hpp:136
void consistencyCheck() const
Verify that the capacity of each set is greater than or equal to the size and that each set is sorted...
Definition: ArrayOfSetsView.hpp:207
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC sizeOfSet(INDEX_TYPE const i) const
Definition: ArrayOfSetsView.hpp:171
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC capacityOfArray(INDEX_TYPE const i) const
Definition: ArrayOfArraysView.hpp:384
std::remove_const_t< INDEX_TYPE > INDEX_TYPE_NC
Since INDEX_TYPE should always be const we need an alias for the non const version.
Definition: ArrayOfArraysView.hpp:174
ArrayOfSetsView & operator=(ArrayOfSetsView const &)=default
Default copy assignment operator, this does a shallow copy.
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE const * getOffsets() const
Definition: ArrayOfArraysView.hpp:353
std::conditional_t< CONST_SIZES, INDEX_TYPE const, INDEX_TYPE_NC > SIZE_TYPE
The type contained by the m_sizes buffer.
Definition: ArrayOfArraysView.hpp:177
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC size() const
Definition: ArrayOfArraysView.hpp:324
LVARRAY_HOST_DEVICE constexpr SIZE_TYPE const * getSizes() const
Definition: ArrayOfArraysView.hpp:342
ArrayOfSetsView()=default
A constructor to create an uninitialized ArrayOfSetsView.
LVARRAY_HOST_DEVICE INDEX_TYPE_NC removeFromSetImpl(INDEX_TYPE const i, ITER const first, ITER const last, CALLBACKS &&cbacks) const
Removes multiple values from the given set.
Definition: ArrayOfSetsView.hpp:443
LVARRAY_HOST_DEVICE bool insertIntoSetImpl(INDEX_TYPE const i, T const &value, CALLBACKS &&cbacks) const
Helper function to insert a value into the given set.
Definition: ArrayOfSetsView.hpp:364
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE bool contains(T const *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, T const &value, Compare &&comp=Compare())
Definition: sortedArrayManipulation.hpp:451
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE bool insert(T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, T const &value, CALLBACKS &&callBacks=CALLBACKS())
Insert the given value into the array if it doesn't already exist.
Definition: sortedArrayManipulation.hpp:620
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
Definition: Macros.hpp:600
T ValueType
An alias for the type contained in the inner arrays.
Definition: ArrayOfArraysView.hpp:185