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.
iterator_impl< T, MatrixType > operator++ (int)
 increment operator.
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.

:
m_data(d),
m_end(e),
m_curRow(std::numeric_limits<unsigned int>::max()),
m_curColumn(std::numeric_limits<unsigned int>::max()),
m_matrix(NULL),
m_curIndex(std::numeric_limits<unsigned int>::max()),
{
if( isEnd )
{
}
}
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.

:
m_data(NULL),
m_end(NULL),
m_transpose(transpose)
{
if( isEnd )
{
m_curRow = std::numeric_limits<unsigned int>::max();
m_curColumn = std::numeric_limits<unsigned int>::max();
m_curIndex = std::numeric_limits<unsigned int>::max();
}
}
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

Definition at line 131 of file StandardMatrix.hpp.

:
m_data(rhs.m_data),
m_end(rhs.m_end),
m_curRow(rhs.m_curRow),
m_curColumn(rhs.m_curColumn),
m_matrix(rhs.m_matrix),
m_curIndex(rhs.m_curIndex),
m_transpose(rhs.m_transpose)
{
}

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.

{
return !(*this == rhs);
}
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.

{
if( m_data )
{
ASSERTL1(m_data < m_end, "Attempt to dereference matrix iterator after its end.");
return *m_data;
}
else
{
return m_matrix->GetPtr()[m_curIndex];
}
}
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.

{
if( m_data )
{
ASSERTL1(m_data < m_end, "Attempt to dereference matrix iterator after its end.");
return *m_data;
}
else
{
return m_matrix->GetPtr()[m_curIndex];
}
}
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.

{
if( m_data )
{
++m_data;
}
else
{
boost::tie(m_curRow, m_curColumn) =
m_matrix->Advance(m_curRow, m_curColumn, m_transpose);
if( m_curRow == std::numeric_limits<unsigned int>::max() )
{
}
else
{
m_curIndex = m_matrix->CalculateIndex(m_curRow, m_curColumn, m_transpose);
}
}
return *this;
}
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.

{
iterator_impl<T, MatrixType> result = *this;
++(*this);
return result;
}
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

Definition at line 142 of file StandardMatrix.hpp.

{
m_data = rhs.m_data;
m_end = rhs.m_end;
m_curRow = rhs.m_curRow;
m_curColumn = rhs.m_curColumn;
m_matrix = rhs.m_matrix;
m_curIndex = rhs.m_curIndex;
m_transpose = rhs.m_transpose;
return *this;
}
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 211 of file StandardMatrix.hpp.

{
return m_data == rhs.m_data &&
m_end == rhs.m_end &&
m_curRow == rhs.m_curRow &&
m_curColumn == rhs.m_curColumn &&
m_matrix == rhs.m_matrix &&
m_curIndex == rhs.m_curIndex &&
m_transpose == rhs.m_transpose;
}

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.