STL like iterator for sub matrices. More...

#include <subMatrixIterator.hh>

Inheritance diagram for concepts::_SubMatrix_iterator< F, _Ref, _Ptr >:
concepts::_Matrix_iterator_base< F::type, _Ref, _Ptr > concepts::OutputOperator

Classes

struct  MatrixType
 Non-constant matrix for non-constant iterator. More...
 
struct  MatrixType< F_, const F::type &, const F::type * >
 Constant matrix for constant iterator. More...
 

Public Types

typedef _Matrix_iterator_base< value_type, _Ref, _Ptr > _Base
 
typedef _SubMatrix_iterator _Self
 
typedef _SubMatrix_iterator< F, const value_type &, const value_type * > const_iterator
 
typedef ptrdiff_t difference_type
 
typedef _SubMatrix_iterator< F, value_type &, value_type * > iterator
 
typedef std::forward_iterator_tag iterator_category
 
typedef MatrixType< F, _Ref, _Ptr >::type matrix_type
 
typedef _Ptr pointer
 
typedef _Ref reference
 
typedef _Base::return_type return_type
 
typedef size_t size_type
 
typedef F::type value_type
 

Public Member Functions

 _SubMatrix_iterator ()
 Constructor. Iterator stands at the end of any matrix. More...
 
template<class _RefR , class _PtrR >
 _SubMatrix_iterator (const _SubMatrix_iterator< F, _RefR, _PtrR > &__x)
 Copy constructor. Also from iterator to constant iterator. More...
 
 _SubMatrix_iterator (matrix_type &m, uint r=0)
 Constructor. More...
 
unsigned int col () const
 Column. More...
 
MatrixType< F, _Ref, _Ptr >::iteratori () const
 
const MatrixType< F, _Ref, _Ptr >::iteratoriend () const
 
Set< IndexRange >::index_iterator * iI () const
 
bool last () const
 Returns true, if iterator is behind the last entry. More...
 
const Set< IndexRange >::index_iterator * lastI () const
 
matrix_typem () const
 
const unsigned int nofCols () const
 Number of columns. More...
 
const unsigned int nofRows () const
 Number of rows. More...
 
return_type operator* () const
 Dereferencation. More...
 
_Selfoperator++ ()
 Increment operator. More...
 
_Self operator++ (int)
 
pointer operator-> () const
 Returns a pointer to the value. More...
 
template<class _RefR , class _PtrR >
_Selfoperator= (const _SubMatrix_iterator< F, _RefR, _PtrR > &__x)
 Assignment. More...
 
unsigned int row () const
 Row. More...
 

Protected Member Functions

virtual std::ostream & info (std::ostream &os) const
 Returns information in an output stream. More...
 

Protected Attributes

unsigned int col_
 
bool last_
 Iterator is behind the last entrance. More...
 
const unsigned int nofCols_
 
const unsigned int nofRows_
 Number of rows and columns. More...
 
unsigned int row_
 Current row and column. More...
 

Private Member Functions

_Selfnext_ ()
 If the iterator is not standing inside submatrix, raise until it's standing inside. More...
 

Private Attributes

std::shared_ptr< typename MatrixType< F, _Ref, _Ptr >::iteratori_
 Iterator over matrix entries. More...
 
std::shared_ptr< const typename MatrixType< F, _Ref, _Ptr >::iteratoriend_
 Iterator behind last matrix entry. More...
 
std::shared_ptr< Set< IndexRange >::index_iterator > iI_
 Iterator over row index range. More...
 
std::shared_ptr< const Set< IndexRange >::index_iterator > lastI_
 Iterator behind the last row index. More...
 
matrix_typem_
 Super matrix. More...
 

Detailed Description

template<class F, class _Ref, class _Ptr>
class concepts::_SubMatrix_iterator< F, _Ref, _Ptr >

STL like iterator for sub matrices.

Parameters
Fmatrix type
_Refreference type of values
_Ptrpointer type to values
Author
Kersten Schmidt, 2005

Definition at line 28 of file subMatrixIterator.hh.

Member Typedef Documentation

◆ _Base

template<class F , class _Ref , class _Ptr >
typedef _Matrix_iterator_base<value_type, _Ref, _Ptr> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::_Base

Definition at line 42 of file subMatrixIterator.hh.

◆ _Self

template<class F , class _Ref , class _Ptr >
typedef _SubMatrix_iterator concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::_Self

Definition at line 41 of file subMatrixIterator.hh.

◆ const_iterator

template<class F , class _Ref , class _Ptr >
typedef _SubMatrix_iterator<F, const value_type&,const value_type*> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::const_iterator

Definition at line 49 of file subMatrixIterator.hh.

◆ difference_type

template<class F , class _Ref , class _Ptr >
typedef ptrdiff_t concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::difference_type

Definition at line 40 of file subMatrixIterator.hh.

◆ iterator

template<class F , class _Ref , class _Ptr >
typedef _SubMatrix_iterator<F, value_type&, value_type*> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iterator

Definition at line 47 of file subMatrixIterator.hh.

◆ iterator_category

template<class F , class _Ref , class _Ptr >
typedef std::forward_iterator_tag concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iterator_category

Definition at line 35 of file subMatrixIterator.hh.

◆ matrix_type

template<class F , class _Ref , class _Ptr >
typedef MatrixType<F, _Ref, _Ptr>::type concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::matrix_type

Definition at line 43 of file subMatrixIterator.hh.

◆ pointer

template<class F , class _Ref , class _Ptr >
typedef _Ptr concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::pointer

Definition at line 37 of file subMatrixIterator.hh.

◆ reference

template<class F , class _Ref , class _Ptr >
typedef _Ref concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::reference

Definition at line 38 of file subMatrixIterator.hh.

◆ return_type

template<class F , class _Ref , class _Ptr >
typedef _Base::return_type concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::return_type

Definition at line 44 of file subMatrixIterator.hh.

◆ size_type

template<class F , class _Ref , class _Ptr >
typedef size_t concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::size_type

Definition at line 39 of file subMatrixIterator.hh.

◆ value_type

template<class F , class _Ref , class _Ptr >
typedef F::type concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::value_type

Definition at line 36 of file subMatrixIterator.hh.

Constructor & Destructor Documentation

◆ _SubMatrix_iterator() [1/3]

template<class F , class _Ref , class _Ptr >
concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::_SubMatrix_iterator ( matrix_type m,
uint  r = 0 
)

Constructor.

Parameters
mmatrix
rrow

◆ _SubMatrix_iterator() [2/3]

template<class F , class _Ref , class _Ptr >
concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::_SubMatrix_iterator ( )

Constructor. Iterator stands at the end of any matrix.

◆ _SubMatrix_iterator() [3/3]

template<class F , class _Ref , class _Ptr >
template<class _RefR , class _PtrR >
concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::_SubMatrix_iterator ( const _SubMatrix_iterator< F, _RefR, _PtrR > &  __x)
inline

Copy constructor. Also from iterator to constant iterator.

Definition at line 61 of file subMatrixIterator.hh.

Member Function Documentation

◆ col()

unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::col
inlineinherited

Column.

Definition at line 75 of file matrixIterator.hh.

◆ i()

template<class F , class _Ref , class _Ptr >
MatrixType<F, _Ref, _Ptr>::iterator* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::i ( ) const
inline

Definition at line 109 of file subMatrixIterator.hh.

◆ iend()

template<class F , class _Ref , class _Ptr >
const MatrixType<F, _Ref, _Ptr>::iterator* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iend ( ) const
inline

Definition at line 112 of file subMatrixIterator.hh.

◆ iI()

template<class F , class _Ref , class _Ptr >
Set<IndexRange>::index_iterator* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iI ( ) const
inline

Definition at line 115 of file subMatrixIterator.hh.

◆ info()

template<class F , class _Ref , class _Ptr >
virtual std::ostream& concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::info ( std::ostream &  os) const
protectedvirtual

Returns information in an output stream.

Reimplemented from concepts::_Matrix_iterator_base< F::type, _Ref, _Ptr >.

◆ last()

bool concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::last
inlineinherited

Returns true, if iterator is behind the last entry.

Definition at line 77 of file matrixIterator.hh.

◆ lastI()

template<class F , class _Ref , class _Ptr >
const Set<IndexRange>::index_iterator* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::lastI ( ) const
inline

Definition at line 116 of file subMatrixIterator.hh.

◆ m()

template<class F , class _Ref , class _Ptr >
matrix_type* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::m ( ) const
inline

Definition at line 119 of file subMatrixIterator.hh.

◆ next_()

template<class F , class _Ref , class _Ptr >
_Self& concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::next_ ( )
private

If the iterator is not standing inside submatrix, raise until it's standing inside.

◆ nofCols()

const unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::nofCols
inlineinherited

Number of columns.

Definition at line 71 of file matrixIterator.hh.

◆ nofRows()

const unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::nofRows
inlineinherited

Number of rows.

Definition at line 69 of file matrixIterator.hh.

◆ operator*()

template<class F , class _Ref , class _Ptr >
return_type concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::operator* ( ) const
inline

Dereferencation.

Definition at line 75 of file subMatrixIterator.hh.

◆ operator++() [1/2]

template<class F , class _Ref , class _Ptr >
_Self& concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::operator++ ( )

Increment operator.

◆ operator++() [2/2]

template<class F , class _Ref , class _Ptr >
_Self concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::operator++ ( int  )
inline

Definition at line 103 of file subMatrixIterator.hh.

◆ operator->()

template<class F , class _Ref , class _Ptr >
pointer concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::operator-> ( ) const
inline

Returns a pointer to the value.

Definition at line 80 of file subMatrixIterator.hh.

◆ operator=()

template<class F , class _Ref , class _Ptr >
template<class _RefR , class _PtrR >
_Self& concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::operator= ( const _SubMatrix_iterator< F, _RefR, _PtrR > &  __x)
inline

Assignment.

Definition at line 87 of file subMatrixIterator.hh.

◆ row()

unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::row
inlineinherited

Row.

Definition at line 73 of file matrixIterator.hh.

Member Data Documentation

◆ col_

unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::col_
protectedinherited

Definition at line 93 of file matrixIterator.hh.

◆ i_

template<class F , class _Ref , class _Ptr >
std::shared_ptr<typename MatrixType<F, _Ref, _Ptr>::iterator> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::i_
private

Iterator over matrix entries.

Definition at line 124 of file subMatrixIterator.hh.

◆ iend_

template<class F , class _Ref , class _Ptr >
std::shared_ptr<const typename MatrixType<F, _Ref, _Ptr>::iterator> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iend_
private

Iterator behind last matrix entry.

Definition at line 126 of file subMatrixIterator.hh.

◆ iI_

template<class F , class _Ref , class _Ptr >
std::shared_ptr<Set<IndexRange>::index_iterator> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::iI_
private

Iterator over row index range.

Definition at line 128 of file subMatrixIterator.hh.

◆ last_

bool concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::last_
protectedinherited

Iterator is behind the last entrance.

Definition at line 95 of file matrixIterator.hh.

◆ lastI_

template<class F , class _Ref , class _Ptr >
std::shared_ptr<const Set<IndexRange>::index_iterator> concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::lastI_
private

Iterator behind the last row index.

Definition at line 130 of file subMatrixIterator.hh.

◆ m_

template<class F , class _Ref , class _Ptr >
matrix_type* concepts::_SubMatrix_iterator< F, _Ref, _Ptr >::m_
private

Super matrix.

Definition at line 132 of file subMatrixIterator.hh.

◆ nofCols_

const unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::nofCols_
protectedinherited

Definition at line 91 of file matrixIterator.hh.

◆ nofRows_

const unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::nofRows_
protectedinherited

Number of rows and columns.

Definition at line 91 of file matrixIterator.hh.

◆ row_

unsigned int concepts::_Matrix_iterator_base< F::type , _Ref, _Ptr >::row_
protectedinherited

Current row and column.

Definition at line 93 of file matrixIterator.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich