|
| void | setName (std::string const &name) |
| | Set the name to be displayed whenever the underlying Buffer's user call back is called. More...
|
| |
|
|
| SortedArray () |
| | Default constructor.
|
| |
| | SortedArray (SortedArray const &src) |
| | The copy constructor, performs a deep copy. More...
|
| |
| | SortedArray (SortedArray &&src)=default |
| | Default move constructor, performs a shallow copy. More...
|
| |
|
| ~SortedArray () |
| | Destructor, frees the values array.
|
| |
| SortedArray & | operator= (SortedArray const &src) |
| | Copy assignment operator, performs a deep copy. More...
|
| |
| SortedArray & | operator= (SortedArray &&src) |
| | Default move assignment operator, performs a shallow copy. More...
|
| |
|
| LVARRAY_HOST_DEVICE SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toView () const & |
| |
| LVARRAY_HOST_DEVICE SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toView () const &&=delete |
| | Overload for rvalues that is deleted. More...
|
| |
| LVARRAY_HOST_DEVICE SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toViewConst () const & |
| |
| LVARRAY_HOST_DEVICE SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toViewConst () const &&=delete |
| | Overload for rvalues that is deleted. More...
|
| |
|
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE | size () const |
| |
|
| LVARRAY_HOST_DEVICE constexpr T const * | data () const |
| |
|
| bool | insert (T const &value) |
| | Insert the given value into the array if it doesn't already exist. More...
|
| |
| template<typename ITER > |
| INDEX_TYPE | insert (ITER const first, ITER const last) |
| | Insert the values in [ first, last ) into the array if they don't already exist. More...
|
| |
| bool | remove (T const &value) |
| | Remove the given value from the array if it exists. More...
|
| |
| template<typename ITER > |
| INDEX_TYPE | remove (ITER const first, ITER const last) |
| | Remove the values in [ first, last ) from the array if they exist. More...
|
| |
|
|
void | clear () |
| | Remove all the values from the array.
|
| |
| void | reserve (INDEX_TYPE const nVals) |
| | Reserve space to store the given number of values without resizing. More...
|
| |
|
| void | move (MemorySpace const space, bool const touch=true) const |
| | Moves the SortedArrayView to the given execution space. More...
|
| |
|
|
using | ValueType = T |
| | The type of the values contained in the SortedArrayView.
|
| |
|
using | IndexType = INDEX_TYPE |
| | The integer type used for indexing.
|
| |
|
using | value_type = T |
| | The type of the values contained in the SortedArrayView, here for stl compatability.
|
| |
|
using | size_type = INDEX_TYPE |
| | The integer type used for indexing, here for stl compatability.
|
| |
| | SortedArrayView () |
| | Default constructor. More...
|
| |
| | SortedArrayView (SortedArrayView const &src)=default |
| | Default copy constructor. Performs a shallow copy and calls the chai::ManagedArray copy constructor. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr | SortedArrayView (SortedArrayView &&src) |
| | Default move constructor, performs a shallow copy. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr | SortedArrayView (INDEX_TYPE const size, BUFFER_TYPE< T > const &buffer) |
| | Construct a new SortedArrayView from the given buffer. More...
|
| |
| SortedArrayView & | operator= (SortedArrayView const &src)=default |
| | Default copy assignment operator, this does a shallow copy. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr SortedArrayView & | operator= (SortedArrayView &&src) |
| | Default move assignment operator, this does a shallow copy. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toView () const |
| |
| LVARRAY_HOST_DEVICE constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toViewConst () const |
| |
| LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > | toSlice () const & |
| |
| LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > | toSlice () const &&=delete |
| | Overload for rvalues that is deleted. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr bool | empty () const |
| |
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE | size () const |
| |
| LVARRAY_HOST_DEVICE bool | contains (T const &value) const |
| |
| LVARRAY_HOST_DEVICE bool | count (T const &value) const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T const & | operator[] (INDEX_TYPE const i) const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T const & | operator() (INDEX_TYPE const i) const |
| |
| LVARRAY_HOST_DEVICE constexpr T const * | data () const |
| |
| LVARRAY_HOST_DEVICE constexpr T const * | begin () const |
| |
| LVARRAY_HOST_DEVICE constexpr T const * | end () const |
| |
| void | move (MemorySpace const space, bool touch=true) const |
| | Moves the SortedArrayView to the given execution space. More...
|
| |
|
BUFFER_TYPE< T > | m_values |
| | Holds the array of values.
|
| |
|
INDEX_TYPE | m_size = 0 |
| | The number of values.
|
| |
template<typename T, typename INDEX_TYPE, template< typename > class BUFFER_TYPE>
class LvArray::SortedArray< T, INDEX_TYPE, BUFFER_TYPE >
This class provides an interface similar to an std::set.
- Template Parameters
-
| T | type of data that is contained by the array. |
| INDEX_TYPE | the integer to use for indexing the components of the array. |
The difference between this class and std::set is that the values are stored contiguously in memory. It maintains O(log(N)) lookup time but insertion and removal are O(N).
The derivation from SortedArrayView is protected to control the conversion to SortedArrayView. Specifically only conversion to SortedArrayView<T const> is allowed.