9 #ifndef CUBBYFLOW_ARRAY1_H 10 #define CUBBYFLOW_ARRAY1_H 33 using Iterator =
typename ContainerType::iterator;
42 explicit Array(
size_t size,
const T& initVal = T());
56 Array(
const std::initializer_list<T>& list);
65 void Set(
const T& value);
68 void Set(
const Array& other);
71 void Set(
const std::initializer_list<T>& list);
77 void Resize(
size_t size,
const T& initVal = T());
83 const T& At(
size_t i)
const;
92 const T* data()
const;
113 void Swap(
Array& other);
116 void Append(
const T& newVal);
119 void Append(
const Array& other);
137 template <
typename Callback>
138 void ForEach(Callback func)
const;
156 template <
typename Callback>
157 void ForEachIndex(Callback func)
const;
180 template <
typename Callback>
181 void ParallelForEach(Callback func);
201 template <
typename Callback>
202 void ParallelForEachIndex(Callback func)
const;
205 T& operator[](
size_t i);
208 const T& operator[](
size_t i)
const;
211 Array& operator=(
const T& other);
220 Array& operator=(
const std::initializer_list<T>& list);
233 template <
typename T>
1-D read-only array accessor class.
Definition: ArrayAccessor1.h:185
std::vector< T > ContainerType
Definition: Array1.h:32
1-D array class.
Definition: Array1.h:29
Definition: pybind11Utils.h:24
Generic N-dimensional array class interface.
Definition: Array.h:28
1-D array accessor class.
Definition: ArrayAccessor1.h:28
typename ContainerType::const_iterator ConstIterator
Definition: Array1.h:34
typename ContainerType::iterator Iterator
Definition: Array1.h:33