OpenCV  2.4.13.2
Open Source Computer Vision
cv::SparseMatConstIterator Class Reference

#include <core.hpp>

Inheritance diagram for cv::SparseMatConstIterator:
cv::SparseMatConstIterator_< _Tp > cv::SparseMatIterator cv::SparseMatIterator_< _Tp >

Public Member Functions

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

Public Attributes

const SparseMatm
 
size_t hashidx
 
ucharptr
 

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>();

Constructor & Destructor Documentation

§ SparseMatConstIterator() [1/3]

cv::SparseMatConstIterator::SparseMatConstIterator ( )
inline

the default constructor

§ SparseMatConstIterator() [2/3]

cv::SparseMatConstIterator::SparseMatConstIterator ( const SparseMat _m)

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

§ SparseMatConstIterator() [3/3]

cv::SparseMatConstIterator::SparseMatConstIterator ( const SparseMatConstIterator it)
inline

the copy constructor

Member Function Documentation

§ node()

const SparseMat::Node * cv::SparseMatConstIterator::node ( ) const
inline

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

§ operator++() [1/2]

SparseMatConstIterator& cv::SparseMatConstIterator::operator++ ( )

moves iterator to the next element

§ operator++() [2/2]

SparseMatConstIterator cv::SparseMatConstIterator::operator++ ( int  )
inline

moves iterator to the next element

§ operator--() [1/2]

SparseMatConstIterator& cv::SparseMatConstIterator::operator-- ( )

moves iterator to the previous element

§ operator--() [2/2]

SparseMatConstIterator cv::SparseMatConstIterator::operator-- ( int  )

moves iterator to the previous element

§ operator=()

SparseMatConstIterator & cv::SparseMatConstIterator::operator= ( const SparseMatConstIterator it)
inline

the assignment operator

§ seekEnd()

void cv::SparseMatConstIterator::seekEnd ( )
inline

moves iterator to the element after the last element

§ value()

template<typename _Tp >
const _Tp & cv::SparseMatConstIterator::value ( ) const
inline

template method returning the current matrix element

Member Data Documentation

§ hashidx

size_t cv::SparseMatConstIterator::hashidx

§ m

const SparseMat* cv::SparseMatConstIterator::m

§ ptr

uchar* cv::SparseMatConstIterator::ptr

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