NPL
Neurological Programs and Libraries
npl::FlatIter< T > Class Template Reference

Flat iterator for NDArray. No information is kept about the current ND index. Just goes through all data. This casts the output to the type specified using T. More...

#include <iterators.h>

Public Member Functions

 FlatIter ()
 Default constructor. Note, this will segfault if you don't use setArray to set the target NDArray/Image. More...
 
 FlatIter (std::shared_ptr< NDArray > in)
 
void setArray (ptr< NDArray > in)
 
FlatIteroperator++ ()
 Prefix increment operator. More...
 
FlatIteroperator-- ()
 Prefix decrement operator. More...
 
operator* () const
 Dereference operator. More...
 
get () const
 Dereference operator. More...
 
void set (T v) const
 Dereference operator. More...
 
void goBegin ()
 Go to beginning of iteration. More...
 
void goEnd ()
 Go to end of iteration. More...
 
bool isEnd () const
 Are we one past the last element? More...
 
bool eof () const
 Are we one past the last element? More...
 
bool isBegin () const
 Are we at the first element. More...
 
bool operator== (const FlatIter &other) const
 Whether the position and parent are the same as another. More...
 
bool operator!= (const FlatIter &other) const
 Whether the position and parent are different from another. More...
 
bool operator< (const FlatIter &other) const
 If the parents are different then false, if they are the same, returns whether this iterator is before the other. More...
 
bool operator> (const FlatIter &other) const
 If the parents are different then false, if they are the same, returns whether this iterator is after the other. More...
 
bool operator<= (const FlatIter &other) const
 If the parents are different then false, if they are the same, returns whether this iterator is the same or before the other. More...
 
bool operator>= (const FlatIter &other) const
 If the parents are different then false, if they are the same, returns whether this iterator is the same or after the other. More...
 

Detailed Description

template<typename T = double>
class npl::FlatIter< T >

Flat iterator for NDArray. No information is kept about the current ND index. Just goes through all data. This casts the output to the type specified using T.

Template Parameters
T

Definition at line 61 of file iterators.h.

Constructor & Destructor Documentation

template<typename T = double>
npl::FlatIter< T >::FlatIter ( )
inline

Default constructor. Note, this will segfault if you don't use setArray to set the target NDArray/Image.

Definition at line 68 of file iterators.h.

template<typename T = double>
npl::FlatIter< T >::FlatIter ( std::shared_ptr< NDArray in)
inline

Definition at line 70 of file iterators.h.

Member Function Documentation

template<typename T = double>
bool npl::FlatIter< T >::eof ( ) const
inline

Are we one past the last element?

Definition at line 232 of file iterators.h.

template<typename T = double>
T npl::FlatIter< T >::get ( ) const
inline

Dereference operator.

Returns
current value

Definition at line 193 of file iterators.h.

template<typename T = double>
void npl::FlatIter< T >::goBegin ( )
inline

Go to beginning of iteration.

Definition at line 217 of file iterators.h.

template<typename T = double>
void npl::FlatIter< T >::goEnd ( )
inline

Go to end of iteration.

Definition at line 222 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::isBegin ( ) const
inline

Are we at the first element.

Definition at line 237 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::isEnd ( ) const
inline

Are we one past the last element?

Definition at line 227 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator!= ( const FlatIter< T > &  other) const
inline

Whether the position and parent are different from another.

Parameters
other
Returns

Definition at line 258 of file iterators.h.

template<typename T = double>
T npl::FlatIter< T >::operator* ( ) const
inline

Dereference operator.

Returns
current value

Definition at line 180 of file iterators.h.

template<typename T = double>
FlatIter& npl::FlatIter< T >::operator++ ( )
inline

Prefix increment operator.

Returns
new value

Definition at line 158 of file iterators.h.

template<typename T = double>
FlatIter& npl::FlatIter< T >::operator-- ( )
inline

Prefix decrement operator.

Returns
new value

Definition at line 169 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator< ( const FlatIter< T > &  other) const
inline

If the parents are different then false, if they are the same, returns whether this iterator is before the other.

Parameters
other
Returns

Definition at line 271 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator<= ( const FlatIter< T > &  other) const
inline

If the parents are different then false, if they are the same, returns whether this iterator is the same or before the other.

Parameters
other
Returns

Definition at line 297 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator== ( const FlatIter< T > &  other) const
inline

Whether the position and parent are the same as another.

Parameters
other
Returns

Definition at line 246 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator> ( const FlatIter< T > &  other) const
inline

If the parents are different then false, if they are the same, returns whether this iterator is after the other.

Parameters
other
Returns

Definition at line 284 of file iterators.h.

template<typename T = double>
bool npl::FlatIter< T >::operator>= ( const FlatIter< T > &  other) const
inline

If the parents are different then false, if they are the same, returns whether this iterator is the same or after the other.

Parameters
other
Returns

Definition at line 310 of file iterators.h.

template<typename T = double>
void npl::FlatIter< T >::set ( v) const
inline

Dereference operator.

Returns
current value

Definition at line 206 of file iterators.h.

template<typename T = double>
void npl::FlatIter< T >::setArray ( ptr< NDArray in)
inline

Definition at line 75 of file iterators.h.


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