LvArray
Classes | Public Types | Protected Types | Protected Member Functions | List of all members
LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE > Class Template Reference

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

#include <ArrayOfSetsView.hpp>

Inheritance diagram for LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >:
Inheritance graph

Classes

class  CallBacks
 This class provides the callbacks for the sortedArrayManipulation routines. More...
 

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
 ArrayOfSetsView ()=default
 A constructor to create an uninitialized ArrayOfSetsView. More...
 
 ArrayOfSetsView (ArrayOfSetsView const &)=default
 Default copy constructor. Performs a shallow copy and calls the chai::ManagedArray copy constructor.
 
 ArrayOfSetsView (ArrayOfSetsView &&)=default
 Default move constructor.
 
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. More...
 
ArrayOfSetsViewoperator= (ArrayOfSetsView const &)=default
 Default copy assignment operator, this does a shallow copy. More...
 
ArrayOfSetsViewoperator= (ArrayOfSetsView &&)=default
 Default move assignment operator, this does a shallow copy. More...
 
ArrayOfSetsView and ArrayOfArraysView creation methods
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView< T, INDEX_TYPE const, BUFFER_TYPE > toView () const
 
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView< T const, INDEX_TYPE const, BUFFER_TYPE > toViewConst () const
 
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > toArrayOfArraysView () const
 
Attribute querying methods
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC sizeOfSet (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC capacityOfSet (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE bool contains (INDEX_TYPE const i, T const &value) const
 
void consistencyCheck () const
 Verify that the capacity of each set is greater than or equal to the size and that each set is sorted unique. More...
 
Methods that provide access to the data
LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, 1, 0, INDEX_TYPE_NCoperator[] (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE constexpr T const & operator() (INDEX_TYPE const i, INDEX_TYPE const j) const
 
Methods that modify the size of an inner set.
LVARRAY_HOST_DEVICE bool insertIntoSet (INDEX_TYPE const i, T const &value) const
 Insert a value into the given set. More...
 
template<typename ITER >
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. More...
 
LVARRAY_HOST_DEVICE bool removeFromSet (INDEX_TYPE const i, T const &value) const
 Remove a value from the given set. More...
 
template<typename ITER >
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. More...
 
Methods dealing with memory spaces
void move (MemorySpace const space, bool const touch=true) const
 Move this ArrayOfSets to the given memory space. More...
 

Protected Types

using ParentClass = ArrayOfArraysView< T, INDEX_TYPE, std::is_const< T >::value, BUFFER_TYPE >
 Alias for the parent class.
 
using INDEX_TYPE_NC = typename ParentClass::INDEX_TYPE_NC
 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.
 
- Protected Types inherited from LvArray::ArrayOfArraysView< T, INDEX_TYPE, std::is_const< T >::value, BUFFER_TYPE >
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.
 
using PairOfBuffers = std::pair< BUFFER_TYPE< U > &, BUFFER_TYPE< U > const & >
 Alias for a std::pair of buffers. More...
 
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.
 

Protected Member Functions

 ArrayOfSetsView (bool)
 Protected constructor to be used by parent classes. More...
 
LVARRAY_HOST_DEVICE constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NCgetSetValues (INDEX_TYPE const i) const
 
Methods to be used by derived classes
template<typename CALLBACKS >
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. More...
 
template<typename ITER , typename CALLBACKS >
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. More...
 
template<typename CALLBACKS >
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. More...
 
template<typename ITER , typename CALLBACKS >
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. More...
 
- Protected Member Functions inherited from LvArray::ArrayOfArraysView< T, INDEX_TYPE, std::is_const< T >::value, BUFFER_TYPE >
 ArrayOfArraysView (bool)
 Protected constructor to be used by parent classes. More...
 
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...
 
void reserveValues (INDEX_TYPE const newValueCapacity, BUFFERS &... buffers)
 Reserve space for the given number of values. More...
 
void compress (BUFFERS &... buffers)
 Compress the arrays so that the values of each array are contiguous with no extra capacity in between. More...
 
void resizeFromOffsets (INDEX_TYPE const numSubArrays, INDEX_TYPE const *const offsets, BUFFERS &... buffers)
 Clears the array and creates a new array with the given number of sub-arrays. More...
 
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...
 
void assimilate (ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&src)
 Steal the resources of src, clearing it in the process. More...
 
void resizeImpl (INDEX_TYPE const newSize, INDEX_TYPE const defaultArrayCapacity, BUFFERS &... buffers)
 Set the number of arrays. More...
 
void free (BUFFERS &... buffers)
 Destroy all the objects held by this array and free all associated memory. More...
 
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...
 
void setCapacityOfArray (INDEX_TYPE const i, INDEX_TYPE const newCapacity, BUFFERS &... buffers)
 Set the capacity of the given array. More...
 
void setName (std::string const &name)
 Set the name to be displayed whenever the underlying Buffer's user call back is called. More...
 
 ArrayOfArraysView ()=default
 A constructor to create an uninitialized ArrayOfArraysView. More...
 
 ArrayOfArraysView (ArrayOfArraysView const &)=default
 Default copy constructor. More...
 
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView (ArrayOfArraysView &&src)
 Default move constructor. More...
 
LVARRAY_HOST_DEVICE 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...
 
LVARRAY_HOST_DEVICE ArrayOfArraysViewoperator= (ArrayOfArraysView &&src)
 Move assignment operator.. More...
 
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, BUFFER_TYPE > toView () const
 
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T, INDEX_TYPE const, true, BUFFER_TYPE > toViewConstSizes () const
 
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > toViewConst () const
 
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC size () const
 
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC sizeOfArray (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE constexpr SIZE_TYPE const * getSizes () const
 
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE const * getOffsets () const
 
LVARRAY_HOST_DEVICE constexpr T const * getValues () const
 
LVARRAY_HOST_DEVICE CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC capacity () const
 
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC capacityOfArray (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC valueCapacity () const
 
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK ArraySlice< T, 1, 0, INDEX_TYPE_NCoperator[] (INDEX_TYPE const i) const
 
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T & operator() (INDEX_TYPE const i, INDEX_TYPE const j) const
 
LVARRAY_HOST_DEVICE void emplaceBack (INDEX_TYPE const i, ARGS &&... args) const
 Append a value to an array. More...
 
LVARRAY_HOST_DEVICE void emplaceBackAtomic (INDEX_TYPE const i, ARGS &&... args) const
 Append a value to an array in a thread safe manner. More...
 
LVARRAY_HOST_DEVICE void appendToArray (INDEX_TYPE const i, ITER const first, ITER const last) const
 Append values to an array. More...
 
LVARRAY_HOST_DEVICE void emplace (INDEX_TYPE const i, INDEX_TYPE const j, ARGS &&... args) const
 Insert a value into an array. More...
 
LVARRAY_HOST_DEVICE void insertIntoArray (INDEX_TYPE const i, INDEX_TYPE const j, ITER const first, ITER const last) const
 Insert values into an array. More...
 
LVARRAY_HOST_DEVICE void eraseFromArray (INDEX_TYPE const i, INDEX_TYPE const j, INDEX_TYPE const n=1) const
 Erase values from an array. More...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from LvArray::ArrayOfArraysView< T, INDEX_TYPE, std::is_const< T >::value, BUFFER_TYPE >
INDEX_TYPE_NC m_numArrays
 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, template< typename > class BUFFER_TYPE>
class LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >

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

Template Parameters
Tthe type stored in the arrays.
INDEX_TYPEthe integer to use for indexing.

When INDEX_TYPE is const m_offsets is not touched when copied between memory spaces. INDEX_TYPE should always be const since ArrayOfSetsview is not allowed to modify the offsets.

When T is const and INDEX_TYPE is const you cannot insert or remove from the View and neither the offsets, sizes, or values are touched when copied between memory spaces.

Constructor & Destructor Documentation

◆ ArrayOfSetsView() [1/3]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::ArrayOfSetsView ( )
default

A constructor to create an uninitialized ArrayOfSetsView.

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

◆ ArrayOfSetsView() [2/3]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::ArrayOfSetsView ( 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 ].

◆ ArrayOfSetsView() [3/3]

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

Protected constructor to be used by parent classes.

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

Member Function Documentation

◆ capacityOfSet()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::capacityOfSet ( INDEX_TYPE const  i) const
inline
Returns
Return the capacity of the given set.
Parameters
iThe set to get the capacity of.

◆ consistencyCheck()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
void LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::consistencyCheck ( ) const
inline

Verify that the capacity of each set is greater than or equal to the size and that each set is sorted unique.

Note
The is intended for debugging.

◆ contains()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE bool LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::contains ( INDEX_TYPE const  i,
T const &  value 
) const
inline
Returns
Return true iff the given set contains the given value.
Parameters
ithe set to search.
valuethe value to search for.

◆ getSetValues()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::getSetValues ( INDEX_TYPE const  i) const
inlineprotected
Returns
Return an ArraySlice1d to the values of the given array.
Parameters
ithe array to access.
Note
Protected because it returns a non-const pointer.

◆ insertIntoSet() [1/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE bool LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::insertIntoSet ( INDEX_TYPE const  i,
T const &  value 
) const
inline

Insert a value into the given set.

Parameters
ithe set to insert into.
valuethe value to insert.
Returns
True iff the value was inserted (the set did not already contain the value).
Precondition
Since the ArrayOfSetsview can't do reallocation or shift the offsets it is up to the user to ensure that the given set has enough space for the new entries.

◆ insertIntoSet() [2/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename ITER >
LVARRAY_HOST_DEVICE INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::insertIntoSet ( INDEX_TYPE const  i,
ITER const  first,
ITER const  last 
) const
inline

Inserts multiple values into the given set.

Template Parameters
ITERAn iterator type.
Parameters
iThe set to insert into.
firstAn iterator to the first value to insert.
lastAn iterator to the end of the values to insert.
Returns
The number of values inserted.
Precondition
The values to insert [ first, last ) must be sorted and contain no duplicates.
Since the ArrayOfSetsView can't do reallocation or shift the offsets it is up to the user to ensure that the given set has enough space for the new entries.

◆ insertIntoSetImpl() [1/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename CALLBACKS >
LVARRAY_HOST_DEVICE bool LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::insertIntoSetImpl ( INDEX_TYPE const  i,
T const &  value,
CALLBACKS &&  cbacks 
) const
inlineprotected

Helper function to insert a value into the given set.

Template Parameters
CALLBACKStype of the call-back helper class.
Parameters
ithe set to insert into.
valuethe value to insert.
cbackscall-back helper class used with the sortedArrayManipulation routines.
Returns
True iff the value was inserted (the set did not already contain the value).

◆ insertIntoSetImpl() [2/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename ITER , typename CALLBACKS >
LVARRAY_HOST_DEVICE INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::insertIntoSetImpl ( INDEX_TYPE const  i,
ITER const  first,
ITER const  last,
CALLBACKS &&  cbacks 
) const
inlineprotected

Inserts multiple values into the given set.

Template Parameters
ITERAn iterator type.
CALLBACKStype of the call-back helper class.
Parameters
iThe set to insert into.
firstAn iterator to the first value to insert.
lastAn iterator to the end of the values to insert.
cbacksHelper class used with the sortedArrayManipulation routines.
Returns
The number of values inserted.
Note
The values to insert [ first, last ) must be sorted and contain no duplicates.

◆ move()

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

Move this ArrayOfSets 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.
This is just a wrapper around the ArrayOfArraysView method. The reason it isn't pulled in with a using statement is that it is detected using IS_VALID_EXPRESSION and this fails with NVCC.

◆ operator()()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr T const& LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::operator() ( INDEX_TYPE const  i,
INDEX_TYPE const  j 
) const
inline
Returns
Return a const reference to the value at the given position in the given array.
Parameters
iThe set to access.
jThe index within the set to access.

◆ operator=() [1/2]

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

Default copy assignment operator, this does a shallow copy.

Returns
*this.

◆ operator=() [2/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
ArrayOfSetsView& LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::operator= ( ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE > &&  )
inlinedefault

Default move assignment operator, this does a shallow copy.

Returns
*this.

◆ operator[]()

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

◆ removeFromSet() [1/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE bool LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::removeFromSet ( INDEX_TYPE const  i,
T const &  value 
) const
inline

Remove a value from the given set.

Parameters
iThe set to remove from.
valueThe value to remove.
Returns
True iff the value was removed (the set previously contained the value).

◆ removeFromSet() [2/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename ITER >
LVARRAY_HOST_DEVICE INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::removeFromSet ( INDEX_TYPE const  i,
ITER const  first,
ITER const  last 
) const
inline

Removes multiple values from the given set.

Template Parameters
ITERAn iterator type.
Parameters
iThe set to remove from.
firstAn iterator to the first value to remove.
lastAn iterator to the end of the values to remove.
Returns
The number of values removed.
Precondition
The values to remove [ first, last ) must be sorted and contain no duplicates.

◆ removeFromSetImpl() [1/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename CALLBACKS >
LVARRAY_HOST_DEVICE bool LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::removeFromSetImpl ( INDEX_TYPE const  i,
T const &  value,
CALLBACKS &&  cbacks 
) const
inlineprotected

Helper function to remove a value from the given set.

Template Parameters
CALLBACKStype of the call-back helper class.
Parameters
ithe set to remove from.
valuethe value to remove.
cbackscall-back helper class used with the sortedArrayManipulation routines.
Returns
True iff the value was removed (the set contained the value).

◆ removeFromSetImpl() [2/2]

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
template<typename ITER , typename CALLBACKS >
LVARRAY_HOST_DEVICE INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::removeFromSetImpl ( INDEX_TYPE const  i,
ITER const  first,
ITER const  last,
CALLBACKS &&  cbacks 
) const
inlineprotected

Removes multiple values from the given set.

Template Parameters
ITERAn iterator type.
CALLBACKStype of the call-back helper class.
Parameters
iThe set to remove from.
firstAn iterator to the first value to remove.
lastAn iterator to the end of the values to remove.
cbacksHelper class used with the sortedArrayManipulation routines.
Returns
The number of values removed.
Note
The values to remove [ first, last ) must be sorted and contain no duplicates.

◆ sizeOfSet()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::sizeOfSet ( INDEX_TYPE const  i) const
inline
Returns
Return the size of the given set.
Parameters
iThe set to get the size of.

◆ toArrayOfArraysView()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::toArrayOfArraysView ( ) const
inline
Returns
Return a new ArrayOfArraysView< T const, INDEX_TYPE const, true >.

◆ toView()

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

◆ toViewConst()

template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
LVARRAY_HOST_DEVICE constexpr ArrayOfSetsView< T const, INDEX_TYPE const, BUFFER_TYPE > LvArray::ArrayOfSetsView< T, INDEX_TYPE, BUFFER_TYPE >::toViewConst ( ) const
inline
Returns
Return a new ArrayOfSetsView< T const, INDEX_TYPE const >.

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