|
cartobase 6.0.6
|
N-dimensional array iterator. More...
#include <cartobase/containers/nditerator.h>


Public Member Functions | |
| NDIterator (T *buffer, const std::vector< int > &dims) | |
| NDIterator (T *buffer, const std::vector< int > &dims, const std::vector< int > &strides) | |
| NDIterator (T *buffer, const std::vector< int > &dims, const std::vector< std::size_t > &strides) | |
| NDIterator (T *buffer, const std::vector< int > &dims, const std::vector< std::ptrdiff_t > &strides) | |
| T & | operator* () const |
| T * | operator-> () const |
Public Member Functions inherited from carto::NDIterator_base | |
| NDIterator_base (const std::vector< int > &dims) | |
| NDIterator_base (const std::vector< int > &dims, const std::vector< int > &strides) | |
| NDIterator_base (const std::vector< int > &dims, const std::vector< std::size_t > &strides) | |
| NDIterator_base (const std::vector< int > &dims, const std::vector< std::ptrdiff_t > &strides) | |
| const std::vector< int > & | position () const |
| std::ptrdiff_t | offset () const |
| NDIterator_base & | operator++ () |
| bool | ended () const |
| void | reset () |
Protected Attributes | |
| T * | _buffer |
Protected Attributes inherited from carto::NDIterator_base | |
| std::vector< int > | _dims |
| std::vector< std::ptrdiff_t > | _strides |
| std::vector< int > | _position |
| std::ptrdiff_t | _offset |
| bool | _ended |
Additional Inherited Members | |
Static Protected Member Functions inherited from carto::NDIterator_base | |
| template<typename T> | |
| static std::vector< std::ptrdiff_t > | to_ptrdiff_v (const std::vector< T > &v) |
N-dimensional array iterator.
Iterates over every element of a N-D array, using strides. The iterator is used more or less like a pointer:
Note that the NDIterator is somewhat sub-optimal since it has to test, at each increment, the bounds of each dimension. In many cases it is possible to lowerage the overhead by implementing an ad-hoc loop for the smallest dimension, and using a line_NDIterator on higher dimensions.
Definition at line 134 of file nditerator.h.
|
inline |
Definition at line 491 of file nditerator.h.
References _buffer, and carto::NDIterator_base::NDIterator_base().
|
inline |
Definition at line 498 of file nditerator.h.
References _buffer, and carto::NDIterator_base::NDIterator_base().
|
inline |
Definition at line 506 of file nditerator.h.
References _buffer, and carto::NDIterator_base::NDIterator_base().
|
inline |
Definition at line 514 of file nditerator.h.
References _buffer, and carto::NDIterator_base::NDIterator_base().
|
inline |
Definition at line 521 of file nditerator.h.
References _buffer, and carto::NDIterator_base::_offset.
|
inline |
Definition at line 526 of file nditerator.h.
References _buffer, and carto::NDIterator_base::_offset.
|
protected |
Definition at line 150 of file nditerator.h.
Referenced by NDIterator(), NDIterator(), NDIterator(), NDIterator(), operator*(), and operator->().