Main MRPT website > C++ reference
MRPT logo

mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE > Struct Template Reference

A random-access iterator for trasversing all the elements of a matrix, left to right, top to bottom. More...

#include <mrpt/math/matrix_iterators.h>

List of all members.

Public Member Functions

bool operator< (const CGenericMatrixIterator< MATRIXTYPE > &it2) const
bool operator> (const CGenericMatrixIterator< MATRIXTYPE > &it2) const
size_t getCol () const
size_t getRow () const
 CGenericMatrixIterator ()
 CGenericMatrixIterator (MATRIXTYPE &obj, size_t start_row, size_t start_col)
MATRIXTYPE::reference operator* () const
CGenericMatrixIterator
< MATRIXTYPE > & 
operator++ ()
CGenericMatrixIterator
< MATRIXTYPE > 
operator++ (int)
CGenericMatrixIterator
< MATRIXTYPE > & 
operator-- ()
CGenericMatrixIterator
< MATRIXTYPE > 
operator-- (int)
CGenericMatrixIterator
< MATRIXTYPE > & 
operator+= (typename iterator_base::difference_type off)
CGenericMatrixIterator
< MATRIXTYPE > 
operator+ (typename iterator_base::difference_type off) const
CGenericMatrixIterator
< MATRIXTYPE > & 
operator-= (typename iterator_base::difference_type off)
CGenericMatrixIterator
< MATRIXTYPE > 
operator- (typename iterator_base::difference_type off) const
iterator_base::difference_type operator- (const CGenericMatrixIterator< MATRIXTYPE > &it) const
MATRIXTYPE::reference operator[] (typename iterator_base::difference_type off) const
bool operator== (const CGenericMatrixIterator< MATRIXTYPE > &it) const
bool operator!= (const CGenericMatrixIterator< MATRIXTYPE > &it) const

Private Types

typedef std::iterator
< std::random_access_iterator_tag,
typename
MATRIXTYPE::value_type > 
iterator_base
typedef MATRIXTYPE::value_type T
 The type of the matrix elements.

Private Member Functions

void check_limits (bool allow_end=false) const

Private Attributes

MATRIXTYPE * m_matrix
 A reference to the source of this iterator.
size_t m_cur_row
size_t m_cur_col
 The iterator points to this element.

Detailed Description

template<class MATRIXTYPE>
struct mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >

A random-access iterator for trasversing all the elements of a matrix, left to right, top to bottom.

Only in DEBUG mode, the iterator checks for the limits of the matrix.

Note:
The size of a matrix being accessed through an iterator should NOT be modifed or the iterator will become invalid.
The end() iterator is represented by column=0, row=N_ROWS.
An excelent reference for iterators theory: http://www.cs.helsinki.fi/u/tpkarkka/alglib/k06/lectures/iterators.html

Definition at line 69 of file matrix_iterators.h.


Member Typedef Documentation

template<class MATRIXTYPE>
typedef std::iterator<std::random_access_iterator_tag,typename MATRIXTYPE::value_type> mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::iterator_base [private]

Definition at line 72 of file matrix_iterators.h.

template<class MATRIXTYPE>
typedef MATRIXTYPE::value_type mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::T [private]

The type of the matrix elements.

Definition at line 75 of file matrix_iterators.h.


Constructor & Destructor Documentation

template<class MATRIXTYPE>
mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::CGenericMatrixIterator (  )  [inline]

Definition at line 109 of file matrix_iterators.h.

template<class MATRIXTYPE>
mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::CGenericMatrixIterator ( MATRIXTYPE &  obj,
size_t  start_row,
size_t  start_col 
) [inline]

Member Function Documentation

template<class MATRIXTYPE>
void mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::check_limits ( bool  allow_end = false  )  const [inline, private]
template<class MATRIXTYPE>
size_t mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::getCol (  )  const [inline]
template<class MATRIXTYPE>
size_t mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::getRow (  )  const [inline]

Definition at line 107 of file matrix_iterators.h.

template<class MATRIXTYPE>
bool mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator!= ( const CGenericMatrixIterator< MATRIXTYPE > &  it  )  const [inline]

Definition at line 184 of file matrix_iterators.h.

template<class MATRIXTYPE>
MATRIXTYPE::reference mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator* (  )  const [inline]

Definition at line 115 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE> mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator+ ( typename iterator_base::difference_type  off  )  const [inline]

Definition at line 160 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE> mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator++ ( int   )  [inline]

Definition at line 124 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE>& mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator++ (  )  [inline]

Definition at line 119 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE>& mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator+= ( typename iterator_base::difference_type  off  )  [inline]
template<class MATRIXTYPE>
iterator_base::difference_type mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator- ( const CGenericMatrixIterator< MATRIXTYPE > &  it  )  const [inline]

Definition at line 173 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE> mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator- ( typename iterator_base::difference_type  off  )  const [inline]

Definition at line 168 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE> mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator-- ( int   )  [inline]

Definition at line 138 of file matrix_iterators.h.

template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE>& mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator-- (  )  [inline]
template<class MATRIXTYPE>
CGenericMatrixIterator<MATRIXTYPE>& mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator-= ( typename iterator_base::difference_type  off  )  [inline]

Definition at line 165 of file matrix_iterators.h.

template<class MATRIXTYPE>
bool mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator< ( const CGenericMatrixIterator< MATRIXTYPE > &  it2  )  const [inline]
template<class MATRIXTYPE>
bool mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator== ( const CGenericMatrixIterator< MATRIXTYPE > &  it  )  const [inline]

Definition at line 181 of file matrix_iterators.h.

template<class MATRIXTYPE>
bool mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator> ( const CGenericMatrixIterator< MATRIXTYPE > &  it2  )  const [inline]
template<class MATRIXTYPE>
MATRIXTYPE::reference mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::operator[] ( typename iterator_base::difference_type  off  )  const [inline]

Definition at line 176 of file matrix_iterators.h.


Member Data Documentation

template<class MATRIXTYPE>
size_t mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::m_cur_col [private]
template<class MATRIXTYPE>
size_t mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::m_cur_row [private]
template<class MATRIXTYPE>
MATRIXTYPE* mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::m_matrix [private]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010