Go to the documentation of this file.
7 #ifndef INCLUDE_JET_ARRAY_ACCESSOR3_H_
8 #define INCLUDE_JET_ARRAY_ACCESSOR3_H_
47 size_t width,
size_t height,
size_t depth, T*
const data);
59 void reset(
size_t width,
size_t height,
size_t depth, T*
const data);
65 const T&
at(
size_t i)
const;
74 T&
at(
size_t i,
size_t j,
size_t k);
77 const T&
at(
size_t i,
size_t j,
size_t k)
const;
139 template <
typename Callback>
172 template <
typename Callback>
195 template <
typename Callback>
216 template <
typename Callback>
223 size_t index(
size_t i,
size_t j,
size_t k)
const;
269 template <
typename T>
286 size_t width,
size_t height,
size_t depth,
const T*
const data);
295 const T&
at(
size_t i)
const;
301 const T&
at(
size_t i,
size_t j,
size_t k)
const;
307 const T*
const end()
const;
354 template <
typename Callback>
387 template <
typename Callback>
408 template <
typename Callback>
415 size_t index(
size_t i,
size_t j,
size_t k)
const;
436 #include "detail/array_accessor3-inl.h"
438 #endif // INCLUDE_JET_ARRAY_ACCESSOR3_H_
T * begin()
Returns the begin iterator of the array.
3-D read-only array accessor class.
Definition: array_accessor3.h:270
size_t height() const
Returns the height of the array.
const T *const begin() const
Returns the begin iterator of the array.
T & at(const Point3UI &pt)
Returns the reference to the element at (pt.x, pt.y, pt.z).
size_t depth() const
Returns the depth of the array.
void parallelForEachIndex(Callback func) const
Iterates the array and invoke given func for each index in parallel using multi-threading.
T & at(size_t i)
Returns the reference to the i-th element.
ConstArrayAccessor(const Size3 &size, const T *const data)
size_t width() const
Returns the width of the array.
T *const begin() const
Returns the begin iterator of the array.
void swap(ArrayAccessor &other)
Swaps the content of with other array accessor.
const T & operator()(const Point3UI &pt) const
Returns the const reference to the element at (pt.x, pt.y, pt.z).
size_t index(size_t i, size_t j, size_t k) const
Returns the linear index of the given =3-D coordinate (i, j, k).
size_t width() const
Returns the width of the array.
const T & operator[](size_t i) const
Returns the const reference to the i-th element.
const T & at(size_t i, size_t j, size_t k) const
Returns the const reference to the element at (i, j, k).
const T & at(size_t i) const
Returns the const reference to the i-th element.
ConstArrayAccessor(const ConstArrayAccessor &other)
Copy constructor.
const T *const end() const
Returns the end iterator of the array.
void forEachIndex(Callback func) const
Iterates the array and invoke given func for each index.
ConstArrayAccessor()
Constructs empty 3-D read-only array accessor.
T & operator()(const Point3UI &pt)
Returns the reference to the element at (pt.x, pt.y, pt.z).
Definition: advection_solver2.h:18
size_t index(const Point3UI &pt) const
Returns the linear index of the given 3-D coordinate (pt.x, pt.y, pt.z).
size_t height() const
Returns the height of the array.
T * end()
Returns the end iterator of the array.
Generic N-dimensional read-only array accessor class interface.
Definition: array_accessor.h:47
const T & operator()(const Point3UI &pt) const
Returns the const reference to the element at (pt.x, pt.y, pt.z).
void forEachIndex(Callback func) const
Iterates the array and invoke given func for each index.
T *const end() const
Returns the end iterator of the array.
void parallelForEachIndex(Callback func) const
Iterates the array and invoke given func for each index in parallel using multi-threading.
3-D size class.
Definition: size3.h:19
void parallelForEach(Callback func)
Iterates the array and invoke given func for each index in parallel.
T & operator[](size_t i)
Returns the reference to the i-th element.
3-D point class.
Definition: point3.h:23
3-D array accessor class.
Definition: array_accessor3.h:31
const T *const data() const
Returns the raw pointer to the array data.
T *const data() const
Returns the raw pointer to the array data.
void reset(size_t width, size_t height, size_t depth, T *const data)
Resets the array.
size_t index(size_t i, size_t j, size_t k) const
Returns the linear index of the given =3-D coordinate (i, j, k).
size_t index(const Point3UI &pt) const
Returns the linear index of the given 3-D coordinate (pt.x, pt.y, pt.z).
const T & at(const Point3UI &pt) const
Returns the const reference to the element at (pt.x, pt.y, pt.z).
T & at(size_t i, size_t j, size_t k)
Returns the reference to the element at (i, j, k).
const T & at(const Point3UI &pt) const
Returns the const reference to the element at (pt.x, pt.y, pt.z).
ArrayAccessor(const Size3 &size, T *const data)
void forEach(Callback func) const
Iterates the array and invoke given func for each index.
const T & at(size_t i) const
Returns the const reference to the i-th element.
T & operator()(size_t i, size_t j, size_t k)
Returns the reference to the element at (i, j, k).
ArrayAccessor()
Constructs empty 3-D array accessor.
ArrayAccessor(size_t width, size_t height, size_t depth, T *const data)
const T & operator()(size_t i, size_t j, size_t k) const
Returns the reference to the element at (i, j, k).
void forEach(Callback func) const
Iterates the array and invoke given func for each index.
Size3 size() const
Returns the size of the array.
size_t depth() const
Returns the depth of the array.
const T & at(size_t i, size_t j, size_t k) const
Returns the const reference to the element at (i, j, k).
const T & operator[](size_t i) const
Returns the const reference to the i-th element.
const T & operator()(size_t i, size_t j, size_t k) const
Returns the const reference to the element at (i, j, k).
ArrayAccessor & operator=(const ArrayAccessor &other)
Copies given array other to this array.
ConstArrayAccessor(size_t width, size_t height, size_t depth, const T *const data)
Size3 size() const
Returns the size of the array.
void set(const ArrayAccessor &other)
Replaces the content with given other array accessor.
ArrayAccessor(const ArrayAccessor &other)
Copy constructor.
ConstArrayAccessor(const ArrayAccessor< T, 3 > &other)
Constructs a read-only array accessor from read/write accessor.
Generic N-dimensional array accessor class interface.
Definition: array_accessor.h:29
void reset(const Size3 &size, T *const data)
Resets the array.