9 #ifndef CUBBYFLOW_ARRAY2_H 10 #define CUBBYFLOW_ARRAY2_H 46 using Iterator =
typename ContainerType::iterator;
55 explicit Array(
const Size2& size,
const T& initVal = T());
62 Array(
size_t width,
size_t height,
const T& initVal = T());
83 Array(
const std::initializer_list<std::initializer_list<T>>& list);
92 void Set(
const T& value);
95 void Set(
const Array& other);
116 void Set(
const std::initializer_list<std::initializer_list<T>>& list);
122 void Resize(
const Size2& size,
const T& initVal = T());
126 void Resize(
size_t width,
size_t height,
const T& initVal = T());
144 const T& At(
size_t i)
const;
150 const T& At(
const Point2UI& pt)
const;
153 T& At(
size_t i,
size_t j);
156 const T& At(
size_t i,
size_t j)
const;
162 size_t Width()
const;
165 size_t Height()
const;
171 const T* data()
const;
192 void Swap(
Array& other);
223 template <
typename Callback>
224 void ForEach(Callback func)
const;
255 template <
typename Callback>
256 void ForEachIndex(Callback func)
const;
278 template <
typename Callback>
279 void ParallelForEach(Callback func);
299 template <
typename Callback>
300 void ParallelForEachIndex(Callback func)
const;
311 T& operator[](
size_t i);
322 const T& operator[](
size_t i)
const;
328 const T& operator()(
const Point2UI& pt)
const;
331 T& operator()(
size_t i,
size_t j);
334 const T& operator()(
size_t i,
size_t j)
const;
337 Array& operator=(
const T& other);
364 Array& operator=(
const std::initializer_list<std::initializer_list<T>>& list);
374 std::vector<T> m_data;
378 template <
typename T>
2-D read-only array accessor class.
Definition: ArrayAccessor2.h:261
2-D point class.
Definition: Point2.h:25
2-D array accessor class.
Definition: ArrayAccessor2.h:31
Definition: pybind11Utils.h:24
Generic N-dimensional array class interface.
Definition: Array.h:28
std::vector< T > ContainerType
Definition: Array2.h:45
typename ContainerType::iterator Iterator
Definition: Array2.h:46
typename ContainerType::const_iterator ConstIterator
Definition: Array2.h:47
2-D array class.
Definition: Array2.h:42