TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
#include <nda/iterators.hpp>
Specialization of nda::array_iterator for 1-dimensional grids.
It is a LegacyRandomAccessIterator.
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 321 of file iterators.hpp.
Public Member Functions | |
array_iterator ()=default | |
Default constructor leaves the iterator in an uninitialized state. | |
array_iterator (std::array< long, 1 > const &lengths, std::array< long, 1 > 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/index of the iterator. | |
bool | operator!= (array_iterator const &rhs) const |
Not-equal-to operator. | |
T & | operator* () const |
Dereference operator. | |
array_iterator & | operator++ () |
Prefix increment operator. | |
array_iterator | operator++ (int) |
Postfix increment operator. | |
array_iterator & | operator+= (std::ptrdiff_t n) |
Compound assignment addition operator increments the iterator a given number of times. | |
array_iterator & | operator-- () |
Prefix decrement operator. | |
array_iterator | operator-- (int) |
Postfix decrement operator. | |
array_iterator & | operator-= (std::ptrdiff_t n) |
Compound assignment subtraction operator decrements the iterator a given number of times. | |
T & | operator-> () const |
Member access operator. | |
bool | operator== (array_iterator const &rhs) const |
Equal-to operator. | |
T & | operator[] (std::ptrdiff_t n) |
Subscript operator. | |
Friends | |
array_iterator | operator+ (array_iterator it, std::ptrdiff_t n) |
Binary addition of an 1-dimensional array iterator with an integer. | |
array_iterator | operator+ (std::ptrdiff_t n, array_iterator it) |
Binary addition of an integer with an 1-dimensional array iterator. | |
std::ptrdiff_t | operator- (array_iterator const &lhs, array_iterator const &rhs) |
Binary subtraction of two 1-dimensional array iterators. | |
array_iterator | operator- (array_iterator it, std::ptrdiff_t n) |
Binary subtraction of an 1-dimensional array iterator with an integer. | |
bool | operator< (array_iterator const &lhs, array_iterator const &rhs) |
Less-than comparison operator for two 1-dimensional array iterators. | |
bool | operator<= (array_iterator const &lhs, array_iterator const &rhs) |
Less-than or equal-to comparison operator for two 1-dimensional array iterators. | |
bool | operator> (array_iterator const &lhs, array_iterator const &rhs) |
Greater-than comparison operator for two 1-dimensional array iterators. | |
bool | operator>= (array_iterator const &lhs, array_iterator const &rhs) |
Greater-than or equal-to comparison operator for two 1-dimensional array iterators. | |
|
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 | Stride of the array/view. |
start | Pointer to the data. |
at_end | Flag indicating if the iterator is at the end. |
Definition at line 362 of file iterators.hpp.
|
inlinenodiscard |
Get the current position/index of the iterator.
std::array<long, 1>
containing the current position/index of the iterator. Definition at line 369 of file iterators.hpp.
|
inlinenodiscard |
Not-equal-to operator.
rhs | Right hand side operand. |
Definition at line 433 of file iterators.hpp.
|
inlinenodiscard |
Dereference operator.
Definition at line 375 of file iterators.hpp.
|
inline |
Prefix increment operator.
Definition at line 387 of file iterators.hpp.
|
inline |
Postfix increment operator.
Definition at line 396 of file iterators.hpp.
|
inline |
Compound assignment addition operator increments the iterator a given number of times.
n | Number of times to increment the iterator. |
Definition at line 441 of file iterators.hpp.
|
inline |
Prefix decrement operator.
Definition at line 406 of file iterators.hpp.
|
inline |
Postfix decrement operator.
Definition at line 415 of file iterators.hpp.
|
inline |
Compound assignment subtraction operator decrements the iterator a given number of times.
n | Number of times to decrement the iterator. |
Definition at line 452 of file iterators.hpp.
|
inline |
Member access operator.
Definition at line 381 of file iterators.hpp.
|
inlinenodiscard |
Equal-to operator.
rhs | Right hand side operand. |
Definition at line 426 of file iterators.hpp.
|
inlinenodiscard |
Subscript operator.
n | Number of times to increment the iterator before dereferencing it. |
Definition at line 499 of file iterators.hpp.
|
friend |
Binary addition of an 1-dimensional array iterator with an integer.
it | 1-dimensional array iterator. |
n | Integer. |
Definition at line 473 of file iterators.hpp.
|
friend |
Binary addition of an integer with an 1-dimensional array iterator.
n | Integer. |
it | 1-dimensional array iterator. |
Definition at line 464 of file iterators.hpp.
|
friend |
Binary subtraction of two 1-dimensional array iterators.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
Definition at line 491 of file iterators.hpp.
|
friend |
Binary subtraction of an 1-dimensional array iterator with an integer.
it | 1-dimensional array iterator. |
n | Integer. |
Definition at line 482 of file iterators.hpp.
|
friend |
Less-than comparison operator for two 1-dimensional array iterators.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
Definition at line 510 of file iterators.hpp.
|
friend |
Less-than or equal-to comparison operator for two 1-dimensional array iterators.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
Definition at line 530 of file iterators.hpp.
|
friend |
Greater-than comparison operator for two 1-dimensional array iterators.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
Definition at line 520 of file iterators.hpp.
|
friend |
Greater-than or equal-to comparison operator for two 1-dimensional array iterators.
lhs | Left hand side operand. |
rhs | Right hand side operand. |
Definition at line 540 of file iterators.hpp.