TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
#include <nda/iterators.hpp>
Iterator for nda::basic_array and nda::basic_array_view types.
It is a LegacyRandomAccessIterator for 1-dimensional and a LegacyForwardIterator for multi-dimensional arrays/views.
Given the shape, strides and a pointer to the start of the data, the iterator uses an nda::detail::grid_iterator
to traverse the element in the array/view.
Rank | Number of dimensions of the array. |
T | Type of the elements in the array (can be const). |
Pointer | Type of the pointer used to access the elements in the array (might be restricted depending on the accessor). |
Definition at line 215 of file iterators.hpp.
Public Member Functions | |
array_iterator ()=default | |
Default constructor leaves the iterator in an uninitialized state. | |
array_iterator (std::array< long, Rank > const &lengths, std::array< long, Rank > const &strides, T *start, bool at_end) | |
Construct an iterator from the shape and the strides of an array/view, a pointer to its data and a flag indicating if the iterator is at the end. | |
auto | indices () |
Get the current position/multi-dimensional index of the iterator. | |
bool | operator!= (array_iterator const &rhs) const |
Not-equal-to operator. | |
value_type & | operator* () const |
Dereference operator. | |
array_iterator & | operator++ () |
Prefix increment operator. | |
array_iterator | operator++ (int) |
Postfix increment operator. | |
value_type & | operator-> () const |
Member access operator. | |
bool | operator== (array_iterator const &rhs) const |
Equal-to operator. | |
|
inline |
Construct an iterator from the shape and the strides of an array/view, a pointer to its data and a flag indicating if the iterator is at the end.
lengths | Shape of the array/view. |
strides | Strides of the array/view. |
start | Pointer to the data. |
at_end | Flag indicating if the iterator is at the end. |
Definition at line 256 of file iterators.hpp.
|
inlinenodiscard |
Get the current position/multi-dimensional index of the iterator.
std::array<long, Rank>
containing the current position/multi-dimensional index of the iterator. Definition at line 263 of file iterators.hpp.
|
inlinenodiscard |
Not-equal-to operator.
rhs | Other iterator to compare to. |
Definition at line 308 of file iterators.hpp.
|
inlinenodiscard |
Dereference operator.
Definition at line 269 of file iterators.hpp.
|
inline |
Prefix increment operator.
Definition at line 281 of file iterators.hpp.
|
inline |
Postfix increment operator.
Definition at line 290 of file iterators.hpp.
|
inlinenodiscard |
Member access operator.
Definition at line 275 of file iterators.hpp.
|
inlinenodiscard |
Equal-to operator.
rhs | Other iterator to compare to. |
Definition at line 301 of file iterators.hpp.