Eigen::InnerIterator< XprType > Class Template Reference

An InnerIterator allows to loop over the element of any matrix expression. More...

#include <CoreIterators.h>

Public Member Functions

 InnerIterator (const XprType &xpr, const Index &outerId)
 
EIGEN_STRONG_INLINE Scalar value () const
 
EIGEN_STRONG_INLINE InnerIteratoroperator++ ()
 
EIGEN_STRONG_INLINE InnerIteratoroperator+= (Index i)
 
EIGEN_STRONG_INLINE InnerIterator operator+ (Index i)
 
EIGEN_STRONG_INLINE Index index () const
 
EIGEN_STRONG_INLINE Index row () const
 
EIGEN_STRONG_INLINE Index col () const
 
EIGEN_STRONG_INLINE operator bool () const
 

Protected Types

typedef internal::inner_iterator_selector< XprType, typename internal::evaluator_traits< XprType >::Kind > IteratorType
 
typedef internal::evaluator< XprTypeEvaluatorType
 
typedef internal::traits< XprType >::Scalar Scalar
 

Protected Attributes

EvaluatorType m_eval
 
IteratorType m_iter
 

Private Member Functions

template<typename T >
 InnerIterator (const EigenBase< T > &, Index outer)
 

Detailed Description

template<typename XprType>
class Eigen::InnerIterator< XprType >

An InnerIterator allows to loop over the element of any matrix expression.

Warning
To be used with care because an evaluator is constructed every time an InnerIterator iterator is constructed.

TODO: add a usage example

Member Typedef Documentation

◆ EvaluatorType

template<typename XprType >
typedef internal::evaluator<XprType> Eigen::InnerIterator< XprType >::EvaluatorType
protected

◆ IteratorType

template<typename XprType >
typedef internal::inner_iterator_selector<XprType, typename internal::evaluator_traits<XprType>::Kind> Eigen::InnerIterator< XprType >::IteratorType
protected

◆ Scalar

template<typename XprType >
typedef internal::traits<XprType>::Scalar Eigen::InnerIterator< XprType >::Scalar
protected

Constructor & Destructor Documentation

◆ InnerIterator() [1/2]

template<typename XprType >
Eigen::InnerIterator< XprType >::InnerIterator ( const XprType xpr,
const Index outerId 
)
inline

Construct an iterator over the outerId -th row or column of xpr

45 : m_eval(xpr), m_iter(m_eval, outerId, xpr.innerSize()) {}
EvaluatorType m_eval
Definition: CoreIterators.h:76
IteratorType m_iter
Definition: CoreIterators.h:77

◆ InnerIterator() [2/2]

template<typename XprType >
template<typename T >
Eigen::InnerIterator< XprType >::InnerIterator ( const EigenBase< T > &  ,
Index  outer 
)
private

Member Function Documentation

◆ col()

template<typename XprType >
EIGEN_STRONG_INLINE Index Eigen::InnerIterator< XprType >::col ( ) const
inline
Returns
the column index of the current coefficient.
71 { return m_iter.col(); }

References Eigen::InnerIterator< XprType >::m_iter.

◆ index()

◆ operator bool()

template<typename XprType >
EIGEN_STRONG_INLINE Eigen::InnerIterator< XprType >::operator bool ( ) const
inline
Returns
true if the iterator *this still references a valid coefficient.
73 { return m_iter; }

References Eigen::InnerIterator< XprType >::m_iter.

◆ operator+()

template<typename XprType >
EIGEN_STRONG_INLINE InnerIterator Eigen::InnerIterator< XprType >::operator+ ( Index  i)
inline
60  {
61  InnerIterator result(*this);
62  result += i;
63  return result;
64  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
InnerIterator(const XprType &xpr, const Index &outerId)
Definition: CoreIterators.h:45

References i.

◆ operator++()

template<typename XprType >
EIGEN_STRONG_INLINE InnerIterator& Eigen::InnerIterator< XprType >::operator++ ( )
inline

Increment the iterator *this to the next non-zero coefficient. Explicit zeros are not skipped over. To skip explicit zeros, see class SparseView

52  {
53  m_iter.operator++();
54  return *this;
55  }

References Eigen::InnerIterator< XprType >::m_iter.

◆ operator+=()

template<typename XprType >
EIGEN_STRONG_INLINE InnerIterator& Eigen::InnerIterator< XprType >::operator+= ( Index  i)
inline
56  {
57  m_iter.operator+=(i);
58  return *this;
59  }

References i, and Eigen::InnerIterator< XprType >::m_iter.

◆ row()

template<typename XprType >
EIGEN_STRONG_INLINE Index Eigen::InnerIterator< XprType >::row ( ) const
inline
Returns
the row index of the current coefficient.
69 { return m_iter.row(); }

References Eigen::InnerIterator< XprType >::m_iter.

◆ value()

template<typename XprType >
EIGEN_STRONG_INLINE Scalar Eigen::InnerIterator< XprType >::value ( ) const
inline
Returns
the value of the current coefficient.
48 { return m_iter.value(); }

References Eigen::InnerIterator< XprType >::m_iter.

Member Data Documentation

◆ m_eval

template<typename XprType >
EvaluatorType Eigen::InnerIterator< XprType >::m_eval
protected

◆ m_iter


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