opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

SparseMatConstIterator Class Reference

SparseMatConstIterator Class Reference
[Basic structures]

Read-Only Sparse Matrix Iterator. More...

#include <mat.hpp>

Inherited by SparseMatConstIterator_< _Tp >, and SparseMatIterator.

Public Member Functions

 SparseMatConstIterator ()
 the default constructor
 SparseMatConstIterator (const SparseMat *_m)
 the full constructor setting the iterator to the first sparse matrix element
 SparseMatConstIterator (const SparseMatConstIterator &it)
 the copy constructor
SparseMatConstIteratoroperator= (const SparseMatConstIterator &it)
 the assignment operator
template<typename _Tp >
const _Tp & value () const
 template method returning the current matrix element
const SparseMat::Nodenode () const
 returns the current node of the sparse matrix. it.node->idx is the current element index
SparseMatConstIteratoroperator-- ()
 moves iterator to the previous element
SparseMatConstIterator operator-- (int)
 moves iterator to the previous element
SparseMatConstIteratoroperator++ ()
 moves iterator to the next element
SparseMatConstIterator operator++ (int)
 moves iterator to the next element
void seekEnd ()
 moves iterator to the element after the last element

Detailed Description

Read-Only Sparse Matrix Iterator.

Here is how to use the iterator to compute the sum of floating-point sparse matrix elements:

 SparseMatConstIterator it = m.begin(), it_end = m.end();
 double s = 0;
 CV_Assert( m.type() == CV_32F );
 for( ; it != it_end; ++it )
    s += it.value<float>();

Definition at line 2959 of file mat.hpp.


Constructor & Destructor Documentation

the default constructor

SparseMatConstIterator ( const SparseMat _m )

the full constructor setting the iterator to the first sparse matrix element

the copy constructor


Member Function Documentation

const SparseMat::Node* node (  ) const

returns the current node of the sparse matrix. it.node->idx is the current element index

Reimplemented in SparseMatIterator.

SparseMatConstIterator& operator++ (  )

moves iterator to the next element

Reimplemented in SparseMatIterator, SparseMatConstIterator_< _Tp >, and SparseMatIterator_< _Tp >.

SparseMatConstIterator operator++ ( int   )

moves iterator to the next element

Reimplemented in SparseMatIterator, SparseMatConstIterator_< _Tp >, and SparseMatIterator_< _Tp >.

SparseMatConstIterator& operator-- (  )

moves iterator to the previous element

SparseMatConstIterator operator-- ( int   )

moves iterator to the previous element

SparseMatConstIterator& operator= ( const SparseMatConstIterator it )

the assignment operator

void seekEnd (  )

moves iterator to the element after the last element

const _Tp& value (  ) const

template method returning the current matrix element

Reimplemented in SparseMatIterator.