Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType > Class Template Reference

#include <StandardMatrix.hpp>

Classes

struct  TagType
 
struct  TagType< const Z >
 

Public Types

typedef T value_type
 
typedef TagType< T >::type iterator_category
 
typedef unsigned int difference_type
 
typedef boost::call_traits
< value_type >::reference 
reference
 
typedef boost::call_traits
< value_type >
::const_reference 
const_reference
 
typedef
boost::remove_reference
< value_type >::type * 
pointer
 

Public Member Functions

 iterator_impl (pointer d, pointer e, bool isEnd=false)
 
 iterator_impl (MatrixType *m, char transpose, bool isEnd=false)
 
 iterator_impl (const iterator_impl< T, MatrixType > &rhs)
 
iterator_impl< T, MatrixType > & operator= (const iterator_impl< T, MatrixType > &rhs)
 
reference operator* ()
 
const_reference operator* () const
 
iterator_impl< T, MatrixType > & operator++ ()
 Prefix increment operator. More...
 
iterator_impl< T, MatrixType > operator++ (int)
 increment operator. More...
 
bool operator== (const iterator_impl< T, MatrixType > &rhs)
 
bool operator!= (const iterator_impl< T, MatrixType > &rhs)
 

Private Attributes

T * m_data
 
T * m_end
 
unsigned int m_curRow
 
unsigned int m_curColumn
 
MatrixType * m_matrix
 
unsigned int m_curIndex
 
char m_transpose
 

Detailed Description

template<typename DataType>
template<typename T, typename MatrixType>
class Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >

Definition at line 75 of file StandardMatrix.hpp.

Member Typedef Documentation

template<typename DataType >
template<typename T , typename MatrixType >
typedef boost::call_traits<value_type>::const_reference Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::const_reference

Definition at line 95 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
typedef unsigned int Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::difference_type

Definition at line 93 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
typedef TagType<T>::type Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::iterator_category

Definition at line 92 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
typedef boost::remove_reference<value_type>::type* Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::pointer

Definition at line 96 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
typedef boost::call_traits<value_type>::reference Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::reference

Definition at line 94 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
typedef T Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::value_type

Definition at line 78 of file StandardMatrix.hpp.

Constructor & Destructor Documentation

template<typename DataType >
template<typename T , typename MatrixType >
Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::iterator_impl ( pointer  d,
pointer  e,
bool  isEnd = false 
)
inline

Definition at line 99 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::iterator_impl ( MatrixType *  m,
char  transpose,
bool  isEnd = false 
)
inline

Definition at line 114 of file StandardMatrix.hpp.

114  :
115  m_data(NULL),
116  m_end(NULL),
117  m_curRow(0),
118  m_curColumn(0),
119  m_matrix(m),
120  m_curIndex(0),
121  m_transpose(transpose)
122  {
123  if( isEnd )
124  {
125  m_curRow = std::numeric_limits<unsigned int>::max();
126  m_curColumn = std::numeric_limits<unsigned int>::max();
127  m_curIndex = std::numeric_limits<unsigned int>::max();
128  }
129  }
template<typename DataType >
template<typename T , typename MatrixType >
Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::iterator_impl ( const iterator_impl< T, MatrixType > &  rhs)
inline

Member Function Documentation

template<typename DataType >
template<typename T , typename MatrixType >
bool Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator!= ( const iterator_impl< T, MatrixType > &  rhs)
inline

Definition at line 222 of file StandardMatrix.hpp.

223  {
224  return !(*this == rhs);
225  }
template<typename DataType >
template<typename T , typename MatrixType >
reference Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator* ( )
inline

Definition at line 154 of file StandardMatrix.hpp.

References ASSERTL1.

155  {
156  if( m_data )
157  {
158  ASSERTL1(m_data < m_end, "Attempt to dereference matrix iterator after its end.");
159  return *m_data;
160  }
161  else
162  {
163  return m_matrix->GetPtr()[m_curIndex];
164  }
165  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<typename DataType >
template<typename T , typename MatrixType >
const_reference Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator* ( ) const
inline

Definition at line 167 of file StandardMatrix.hpp.

References ASSERTL1.

168  {
169  if( m_data )
170  {
171  ASSERTL1(m_data < m_end, "Attempt to dereference matrix iterator after its end.");
172  return *m_data;
173  }
174  else
175  {
176  return m_matrix->GetPtr()[m_curIndex];
177  }
178  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
template<typename DataType >
template<typename T , typename MatrixType >
iterator_impl<T, MatrixType>& Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator++ ( )
inline

Prefix increment operator.

Definition at line 181 of file StandardMatrix.hpp.

182  {
183  if( m_data )
184  {
185  ++m_data;
186  }
187  else
188  {
189  boost::tie(m_curRow, m_curColumn) =
191  if( m_curRow == std::numeric_limits<unsigned int>::max() )
192  {
194  }
195  else
196  {
197  m_curIndex = m_matrix->CalculateIndex(m_curRow, m_curColumn, m_transpose);
198  }
199  }
200  return *this;
201  }
template<typename DataType >
template<typename T , typename MatrixType >
iterator_impl<T, MatrixType> Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator++ ( int  )
inline

increment operator.

Definition at line 204 of file StandardMatrix.hpp.

205  {
206  iterator_impl<T, MatrixType> result = *this;
207  ++(*this);
208  return result;
209  }
template<typename DataType >
template<typename T , typename MatrixType >
iterator_impl<T, MatrixType>& Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator= ( const iterator_impl< T, MatrixType > &  rhs)
inline
template<typename DataType >
template<typename T , typename MatrixType >
bool Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::operator== ( const iterator_impl< T, MatrixType > &  rhs)
inline

Member Data Documentation

template<typename DataType >
template<typename T , typename MatrixType >
unsigned int Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_curColumn
private

Definition at line 234 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
unsigned int Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_curIndex
private

Definition at line 236 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
unsigned int Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_curRow
private

Definition at line 233 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
T* Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_data
private

Definition at line 229 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
T* Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_end
private

Definition at line 230 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
MatrixType* Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_matrix
private

Definition at line 235 of file StandardMatrix.hpp.

template<typename DataType >
template<typename T , typename MatrixType >
char Nektar::NekMatrix< DataType, StandardMatrixTag >::iterator_impl< T, MatrixType >::m_transpose
private

Definition at line 237 of file StandardMatrix.hpp.