array.hpp#
-
template<typename T>
class Array# Public Functions
-
inline Array(size_t n = 0)#
Default constructor
- Parameters
n – size of array
-
inline Array(Array &&other)#
Construct in host for device from array
- Parameters
other_arr – array to construct from
n – size of array Move constructor; this allows the array to be passed as a return value from a function sapping the pointers and keeping the allocated data on the heap.
-
inline Array(Array &other)#
Copy constructor; declaring the move constructor makes compiler implicitly declare the copy constructor deleted
-
inline T &operator[](size_t i)#
Write access to the array (host)
- Parameters
i – index
- Returns
reference to i-th element
-
inline const T &operator[](size_t i) const#
Read only access to the array (host)
- Parameters
i – index
- Returns
reference to i-th element
-
inline size_t size() const#
Get array size
- Returns
array size
-
inline void resize(size_t n)#
Resize array droping stored values
-
inline Array(size_t n = 0)#