mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
mf::ndarray_iterator< Array > Class Template Reference

Random access iterator which traverses an ndarray_view. More...

#include <ndarray_iterator.h>

Inheritance diagram for mf::ndarray_iterator< Array >:

Public Types

using index_type = typename Array::index_type
 
using coordinates_type = typename Array::coordinates_type
 

Public Member Functions

 ndarray_iterator ()=default
 
 ndarray_iterator (const Array &array, index_type index, pointer ptr)
 
 ndarray_iterator (const ndarray_iterator &)=default
 
ndarray_iteratoroperator= (const ndarray_iterator &)
 
ndarray_iteratoroperator++ ()
 
ndarray_iterator operator++ (int)
 
ndarray_iteratoroperator-- ()
 
ndarray_iterator operator-- (int)
 
ndarray_iteratoroperator+= (std::ptrdiff_t)
 
ndarray_iteratoroperator-= (std::ptrdiff_t)
 
reference operator* () const noexcept
 
pointer operator-> () const noexcept
 
reference operator[] (std::ptrdiff_t n) const
 
index_type index () const noexcept
 
coordinates_type coordinates () const noexcept
 

Static Public Attributes

static constexpr std::size_t dimension = Array::dimension
 

Friends

bool operator== (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
bool operator!= (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
bool operator< (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
bool operator<= (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
bool operator> (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
bool operator>= (const ndarray_iterator &a, const ndarray_iterator &b) noexcept
 
ndarray_iterator operator+ (const ndarray_iterator &it, std::ptrdiff_t n)
 
ndarray_iterator operator+ (std::ptrdiff_t n, const ndarray_iterator &it)
 
ndarray_iterator operator- (const ndarray_iterator &it, std::ptrdiff_t n)
 
std::ptrdiff_t operator- (const ndarray_iterator &a, const ndarray_iterator &b)
 

Detailed Description

template<typename Array>
class mf::ndarray_iterator< Array >

Random access iterator which traverses an ndarray_view.

Always traverses the elements in order of increasing index, regardless of strides. Random-access iterator operations (addition, comparation, etc.) act on index values. Index and coordinates of current item can be accessed using index() and coordinates(). Incrementation and decrementation are optimized when the strides of the ndarray_view are (partially) default, i.e. items with sequential indices have sequential memory addresses, possibly with padding inbetween. This can be for the entire ndarray_view, or just for smaller segments at a time.

Member Typedef Documentation

template<typename Array >
using mf::ndarray_iterator< Array >::coordinates_type = typename Array::coordinates_type
template<typename Array >
using mf::ndarray_iterator< Array >::index_type = typename Array::index_type

Constructor & Destructor Documentation

template<typename Array >
mf::ndarray_iterator< Array >::ndarray_iterator ( )
default
template<typename Array >
mf::ndarray_iterator< Array >::ndarray_iterator ( const Array &  array,
index_type  index,
pointer  ptr 
)
template<typename Array >
mf::ndarray_iterator< Array >::ndarray_iterator ( const ndarray_iterator< Array > &  )
default

Member Function Documentation

template<typename Array >
coordinates_type mf::ndarray_iterator< Array >::coordinates ( ) const
inlinenoexcept
template<typename Array >
index_type mf::ndarray_iterator< Array >::index ( ) const
inlinenoexcept
template<typename Array >
reference mf::ndarray_iterator< Array >::operator* ( ) const
inlinenoexcept
template<typename Array >
auto mf::ndarray_iterator< Array >::operator++ ( )
template<typename Array >
auto mf::ndarray_iterator< Array >::operator++ ( int  )
template<typename Array >
auto mf::ndarray_iterator< Array >::operator+= ( std::ptrdiff_t  n)
template<typename Array >
auto mf::ndarray_iterator< Array >::operator-- ( )
template<typename Array >
auto mf::ndarray_iterator< Array >::operator-- ( int  )
template<typename Array >
auto mf::ndarray_iterator< Array >::operator-= ( std::ptrdiff_t  n)
template<typename Array >
pointer mf::ndarray_iterator< Array >::operator-> ( ) const
inlinenoexcept
template<typename Array >
auto mf::ndarray_iterator< Array >::operator= ( const ndarray_iterator< Array > &  it)
template<typename Array >
reference mf::ndarray_iterator< Array >::operator[] ( std::ptrdiff_t  n) const
inline

Friends And Related Function Documentation

template<typename Array >
bool operator!= ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
ndarray_iterator operator+ ( const ndarray_iterator< Array > &  it,
std::ptrdiff_t  n 
)
friend
template<typename Array >
ndarray_iterator operator+ ( std::ptrdiff_t  n,
const ndarray_iterator< Array > &  it 
)
friend
template<typename Array >
ndarray_iterator operator- ( const ndarray_iterator< Array > &  it,
std::ptrdiff_t  n 
)
friend
template<typename Array >
std::ptrdiff_t operator- ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
bool operator< ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
bool operator<= ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
bool operator== ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
bool operator> ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend
template<typename Array >
bool operator>= ( const ndarray_iterator< Array > &  a,
const ndarray_iterator< Array > &  b 
)
friend

Member Data Documentation

template<typename Array >
constexpr std::size_t mf::ndarray_iterator< Array >::dimension = Array::dimension
static

The documentation for this class was generated from the following files: