20 #ifdef LVARRAY_BOUNDS_CHECK 27 #define SORTEDARRAY_CHECK_BOUNDS( index ) \ 28 LVARRAY_ERROR_IF( index < 0 || index >= size(), \ 29 "Array Bounds Check Failed: index=" << index << " size()=" << size()) 31 #else // LVARRAY_BOUNDS_CHECK 38 #define SORTEDARRAY_CHECK_BOUNDS( index ) 40 #endif // LVARRAY_BOUNDS_CHECK 57 template<
typename >
class BUFFER_TYPE >
182 {
return size() == 0; }
275 #if defined(LVARRAY_USE_CUDA) 276 if( space == MemorySpace::GPU ) touch =
false;
315 template<
typename >
class BUFFER_TYPE >
316 constexpr
bool isSortedArrayView< SortedArrayView< T, INDEX_TYPE, BUFFER_TYPE > > =
true;
SortedArrayView & operator=(SortedArrayView const &src)=default
Default copy assignment operator, this does a shallow copy.
void move(MemorySpace const space, bool touch=true) const
Moves the SortedArrayView to the given execution space.
bool contains(T const &value) const
constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > toSlice() const &
BUFFER_TYPE< T > m_values
Holds the array of values.
constexpr SortedArrayView(SortedArrayView &&src)
Default move constructor, performs a shallow copy.
constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > toViewConst() const
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
constexpr T const & operator()(INDEX_TYPE const i) const
INDEX_TYPE m_size
The number of values.
constexpr T const * begin() const
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK
Expands to constexpr when array bound checking is disabled.
bool count(T const &value) const
Contains the implementation of LvArray::ArraySlice.
INDEX_TYPE size_type
The integer type used for indexing, here for stl compatability.
constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > toView() const
SortedArrayView()
Default constructor.
Contains functions for manipulating buffers.
constexpr T const * end() const
constexpr INDEX_TYPE size() const
constexpr bool isSortedArrayView
True if the template type is a SortedArrayView.
localIndex const value_type
The type of the values contained in the SortedArrayView, here for stl compatability.
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())
constexpr T const & operator[](INDEX_TYPE const i) const
This file contains common sorted array manipulation routines. Aside from the functions that take a ca...
INDEX_TYPE IndexType
The integer type used for indexing.
constexpr SortedArrayView(INDEX_TYPE const size, BUFFER_TYPE< T > const &buffer)
Construct a new SortedArrayView from the given buffer.
localIndex const ValueType
The type of the values contained in the SortedArrayView.
constexpr bool empty() const
constexpr SortedArrayView & operator=(SortedArrayView &&src)
Default move assignment operator, this does a shallow copy.
constexpr T const * data() const
This class provides a view into a SortedArray.
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
#define SORTEDARRAY_CHECK_BOUNDS(index)
Check that index falls within the size of the first dimension.