latest version v1.9 - last update 10 Apr 2010 |
iterator type (allows read and write operations). More...
#include <ltiGenericMatrix.h>
Public Member Functions | |
iterator () | |
iterator (const iterator &other) | |
iterator & | operator++ () |
iterator | operator++ (int) |
iterator & | operator-- () |
iterator | operator-- (int) |
iterator & | operator+= (const int n) |
iterator & | operator-= (const int n) |
iterator | operator+ (const int n) |
iterator | operator- (const int n) |
bool | operator== (const iterator &other) const |
bool | operator!= (const iterator &other) const |
bool | operator< (const iterator &other) const |
bool | operator> (const iterator &other) const |
bool | operator<= (const iterator &other) const |
bool | operator>= (const iterator &other) const |
T & | operator* () |
iterator & | operator= (const iterator &other) |
Protected Member Functions | |
int | getPos () const |
const genericMatrix< T > * | getGenericMatrix () const |
iterator (const int startPos, genericMatrix< T > *vct) |
iterator type (allows read and write operations).
The use of the iterator classes is similar to the iterators of the STL (Standard Template Library). See lti::genericMatrix::begin() for an example
For the debugging version of the iterators, boundary check will be done! This explains the low speed of the iterators of the debug version. In the release version, no boundary check will be done, and the iterators are sometimes a factor 10 faster than the debug iterators.
The use of the access operator at(.) is faster than the iterators in the debug version only. If you need to iterate on a genericMatrix use iterators instead (in the release version iterators are approx. a factor 3 faster than "at(.)").
Iterators don't work on lined matrices.
CAUTION: Try to use the prefix incremental operator (i.e. ++it) instead of the postfix operator (i.e. it++) to allow efficient code also in debug-modus!
lti::genericMatrix< T >::iterator::iterator | ( | ) | [inline] |
default constructor
Referenced by lti::genericMatrix< T >::iterator::operator+(), and lti::genericMatrix< T >::iterator::operator-().
lti::genericMatrix< T >::iterator::iterator | ( | const iterator & | other | ) | [inline] |
copy constructor
lti::genericMatrix< T >::iterator::iterator | ( | const int | startPos, | |
genericMatrix< T > * | vct | |||
) | [inline, explicit, protected] |
default constructor (for internal use only) NEVER USE THIS CONSTRUCTOR, OR YOUR CODE WILL NOT COMPILE IN THE RELEASE VERSION!
const genericMatrix<T>* lti::genericMatrix< T >::iterator::getGenericMatrix | ( | ) | const [inline, protected] |
for internal use only!!! This method does not exist in the release version!
Referenced by lti::genericMatrix< T >::const_iterator::operator=().
int lti::genericMatrix< T >::iterator::getPos | ( | ) | const [inline, protected] |
for internal use only!!! This method does not exist in the release version!
Referenced by lti::genericMatrix< T >::const_iterator::operator!=(), lti::genericMatrix< T >::const_iterator::operator=(), and lti::genericMatrix< T >::const_iterator::operator==().
bool lti::genericMatrix< T >::iterator::operator!= | ( | const iterator & | other | ) | const [inline] |
compare
T& lti::genericMatrix< T >::iterator::operator* | ( | ) | [inline] |
get pointed data
iterator lti::genericMatrix< T >::iterator::operator+ | ( | const int | n | ) | [inline] |
advance (skip) some elements.
Use this operator with care! Note that you can skip the end of the vector, and read (or even worse: write!) out of bounds!
References lti::genericMatrix< T >::iterator::iterator().
iterator lti::genericMatrix< T >::iterator::operator++ | ( | int | ) | [inline] |
advance to next item
iterator& lti::genericMatrix< T >::iterator::operator++ | ( | ) | [inline] |
advance to next item
iterator& lti::genericMatrix< T >::iterator::operator+= | ( | const int | n | ) | [inline] |
advance (skip) some elements.
Use this operator with care! Note that you can skip the end of the genericMatrix, and read (or even worse: write!) out of bounds!
iterator lti::genericMatrix< T >::iterator::operator- | ( | const int | n | ) | [inline] |
recede (skip) some elements.
Use this operator with care! Note that you can skip the beginning of the vector, and read (or even worse: write!) out of bounds!
References lti::genericMatrix< T >::iterator::iterator().
iterator lti::genericMatrix< T >::iterator::operator-- | ( | int | ) | [inline] |
recede to previos item
iterator& lti::genericMatrix< T >::iterator::operator-- | ( | ) | [inline] |
recede to previos item
iterator& lti::genericMatrix< T >::iterator::operator-= | ( | const int | n | ) | [inline] |
recede (skip) some elements.
Use this operator with care! Note that you can skip the end of the genericMatrix, and read (or even worse: write!) out of bounds!
bool lti::genericMatrix< T >::iterator::operator< | ( | const iterator & | other | ) | const [inline] |
bool lti::genericMatrix< T >::iterator::operator<= | ( | const iterator & | other | ) | const [inline] |
iterator& lti::genericMatrix< T >::iterator::operator= | ( | const iterator & | other | ) | [inline] |
copy member
bool lti::genericMatrix< T >::iterator::operator== | ( | const iterator & | other | ) | const [inline] |
compare
bool lti::genericMatrix< T >::iterator::operator> | ( | const iterator & | other | ) | const [inline] |
bool lti::genericMatrix< T >::iterator::operator>= | ( | const iterator & | other | ) | const [inline] |