Wt::Matrix< T >::const_iterator Class Reference

#include <matrix.h>

Inheritance diagram for Wt::Matrix< T >::const_iterator:

Inheritance graph
[legend]
Collaboration diagram for Wt::Matrix< T >::const_iterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 const_iterator (const Matrix *matrix_p=0, int row=0, int column=0)
 const_iterator (const iterator &other)
bool operator== (const iterator &other) const
bool operator!= (const iterator &other) const
iteratoroperator++ ()
T & operator * () const
T * operator-> () const
int row () const
int column () const

Detailed Description

template<typename T>
class Wt::Matrix< T >::const_iterator

Definition at line 100 of file matrix.h.


Constructor & Destructor Documentation

template<typename T>
Wt::Matrix< T >::const_iterator::const_iterator ( const Matrix matrix_p = 0,
int  row = 0,
int  column = 0 
) [inline]

Definition at line 102 of file matrix.h.

00103                                                     :
00104         iterator(const_cast<Matrix*>(matrix_p), row, column) {}

template<typename T>
Wt::Matrix< T >::const_iterator::const_iterator ( const iterator other  )  [inline]

Definition at line 106 of file matrix.h.

00106                                               :
00107         iterator(other) {}
    };


Member Function Documentation

template<typename T>
int Wt::Matrix< T >::iterator::column (  )  const [inline, inherited]

Definition at line 90 of file matrix.h.

References Wt::Matrix< T >::iterator::column_.

00090                            {
00091             return column_;
00092         }

template<typename T>
T& Wt::Matrix< T >::iterator::operator * (  )  const [inline, inherited]

Definition at line 75 of file matrix.h.

References Wt::Matrix< T >::iterator::column_, Wt::Matrix< T >::iterator::m_, and Wt::Matrix< T >::iterator::row_.

00075                              {
00076             Matrix& matrix = *m_;
00077             T& t = matrix[row_][column_];
00078             return t;
00079         }

template<typename T>
bool Wt::Matrix< T >::iterator::operator!= ( const iterator other  )  const [inline, inherited]

Definition at line 53 of file matrix.h.

00053                                                      {
00054             return !(*this == other);
00055         }

template<typename T>
iterator& Wt::Matrix< T >::iterator::operator++ (  )  [inline, inherited]

Definition at line 56 of file matrix.h.

References Wt::Matrix< T >::iterator::column_, Wt::Matrix< T >::iterator::m_, Wt::Matrix< T >::numCols(), Wt::Matrix< T >::numRows(), and Wt::Matrix< T >::iterator::row_.

00056                                {
00057             const Matrix& matrix = *m_;
00058             if (column_ < matrix.numCols() - 1) {
00059                 ++column_;
00060             } else {
00061                 // end of column
00062                 if (row_ < matrix.numRows() - 1) {
00063                     // advance row
00064                     ++row_;
00065                     column_ = 0;
00066                 } else {
00067                     // end()
00068                     row_ = -1;
00069                     column_ = -1;
00070                 }
00071             }
00072             return *this;
00073         }

Here is the call graph for this function:

template<typename T>
T* Wt::Matrix< T >::iterator::operator-> (  )  const [inline, inherited]

Definition at line 80 of file matrix.h.

References Wt::Matrix< T >::iterator::column_, Wt::Matrix< T >::iterator::m_, and Wt::Matrix< T >::iterator::row_.

00080                               {
00081             Matrix& matrix = *m_;
00082             T* t = &matrix[row_][column_];
00083             return t;
00084         }

template<typename T>
bool Wt::Matrix< T >::iterator::operator== ( const iterator other  )  const [inline, inherited]

Definition at line 50 of file matrix.h.

References Wt::Matrix< T >::iterator::column_, and Wt::Matrix< T >::iterator::row_.

00050                                                      {
00051             return (other.column_ == column_) && (other.row_ == row_);
00052         }

template<typename T>
int Wt::Matrix< T >::iterator::row (  )  const [inline, inherited]

Definition at line 86 of file matrix.h.

References Wt::Matrix< T >::iterator::row_.

00086                         {
00087             return row_;
00088         }


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

Generated Fri Jul 28 19:30:18 2006.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.