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 >
357 template<
typename CALLBACKS >
363 INDEX_TYPE
const setSize =
sizeOfSet( i );
382 template<
typename ITER,
typename CALLBACKS >
387 CALLBACKS && cbacks )
const 391 INDEX_TYPE
const setSize =
sizeOfSet( i );
398 std::forward< CALLBACKS >( cbacks ) );
411 template<
typename CALLBACKS >
417 INDEX_TYPE
const setSize =
sizeOfSet( i );
436 template<
typename ITER,
typename CALLBACKS >
441 CALLBACKS && cbacks )
const 445 INDEX_TYPE
const setSize =
sizeOfSet( i );
452 std::forward< CALLBACKS >( cbacks ) );
489 T * incrementSize( T *
const curPtr, INDEX_TYPE
const nToAdd )
const 492 #ifdef LVARRAY_BOUNDS_CHECK 494 "ArrayOfSetsView cannot do reallocation." );
498 return m_aos.getSetValues( m_indexOfSet );
506 INDEX_TYPE
const m_indexOfSet;
#define LVARRAY_UNUSED_VARIABLE(X)
Mark X as an unused variable, used to silence compiler warnings.
INDEX_TYPE_NC removeFromSet(INDEX_TYPE const i, ITER const first, ITER const last) const
Removes multiple values from the given set.
constexpr T & operator()(INDEX_TYPE const i, INDEX_TYPE const j) const
#define ARRAYOFARRAYS_CHECK_BOUNDS(i)
Check that i is a valid array index.
bool isSortedUnique(ITER first, ITER const last, Compare &&comp=Compare())
INDEX_TYPE_NC insertIntoSet(INDEX_TYPE const i, ITER const first, ITER const last) const
Inserts multiple values into the given set.
INDEX_TYPE size_type
The integer type used for indexing, here for stl compatability.
bool insertIntoSetImpl(INDEX_TYPE const i, T const &value, CALLBACKS &&cbacks) const
Helper function to insert a value into the given set.
#define LVARRAY_ERROR_IF(EXP, MSG)
Abort execution if EXP is true.
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
INDEX_TYPE IndexType
The integer type used for indexing.
BUFFER_TYPE< INDEX_TYPE > m_offsets
constexpr INDEX_TYPE_NC sizeOfSet(INDEX_TYPE const i) const
constexpr ArrayOfSetsView< T, INDEX_TYPE const, BUFFER_TYPE > toView() const
constexpr INDEX_TYPE_NC size() const
BUFFER_TYPE< T > m_values
void move(MemorySpace const space, bool touch=true) const
Move this ArrayOfArrays to the given memory space.
Contains templates useful for type manipulation.
bool insertIntoSet(INDEX_TYPE const i, T const &value) const
Insert a value into the given set.
constexpr INDEX_TYPE_NC capacityOfArray(INDEX_TYPE const i) const
BUFFER_TYPE< SIZE_TYPE > m_sizes
Holds the size of each array.
T value_type
An alias for the type contained in the inner arrays, here for stl compatability.
Contains the implementation of LvArray::ArraySlice.
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.
constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > operator[](INDEX_TYPE const i) const
INDEX_TYPE_NC insertIntoSetImpl(INDEX_TYPE const i, ITER const first, ITER const last, CALLBACKS &&cbacks) const
Inserts multiple values into the given set.
constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > getSetValues(INDEX_TYPE const i) const
constexpr ArraySlice< T const, 1, 0, INDEX_TYPE_NC > operator[](INDEX_TYPE const i) const
constexpr ArrayOfSetsView< T const, INDEX_TYPE const, BUFFER_TYPE > toViewConst() const
#define LVARRAY_ERROR_IF_GT(lhs, rhs)
Raise a hard error if one value compares greater than the other.
This class provides a no-op callbacks interface for the ArrayManipulation sorted routines.
This class provides a view into an array of sets like object.
This class provides a view into an array of arrays like object.
bool contains(INDEX_TYPE const i, T const &value) const
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.
constexpr INDEX_TYPE_NC capacityOfSet(INDEX_TYPE const i) const
constexpr INDEX_TYPE_NC sizeOfArray(INDEX_TYPE const i) const
void move(MemorySpace const space, bool const touch=true) const
Move this ArrayOfSets to the given memory space.
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.
CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC capacity() const
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.
MemorySpace
An enum containing the available memory spaces.
bool contains(T const *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, T const &value, Compare &&comp=Compare())
#define LVARRAY_ERROR_IF_GT_MSG(lhs, rhs, msg)
Raise a hard error if one value compares greater than the other.
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.
bool removeFromSetImpl(INDEX_TYPE const i, T const &value, CALLBACKS &&cbacks) const
Helper function to remove a value from the given set.
void consistencyCheck() const
Verify that the capacity of each set is greater than or equal to the size and that each set is sorted...
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.
ArrayOfSetsView & operator=(ArrayOfSetsView const &)=default
Default copy assignment operator, this does a shallow copy.
INDEX_TYPE_NC removeFromSetImpl(INDEX_TYPE const i, ITER const first, ITER const last, CALLBACKS &&cbacks) const
Removes multiple values from the given set.
bool removeFromSet(INDEX_TYPE const i, T const &value) const
Remove a value from the given set.
std::conditional_t< CONST_SIZES, INDEX_TYPE const, INDEX_TYPE_NC > SIZE_TYPE
The type contained by the m_sizes buffer.
constexpr T const & operator()(INDEX_TYPE const i, INDEX_TYPE const j) const
constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > toArrayOfArraysView() const
ArrayOfSetsView()=default
A constructor to create an uninitialized ArrayOfSetsView.
constexpr INDEX_TYPE_NC valueCapacity() const
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
T ValueType
An alias for the type contained in the inner arrays.