opencv: cv::SparseMatConstIterator Class Reference

Public Member Functions | Public Attributes

# cv::SparseMatConstIterator Class Reference

`#include <core.hpp>`

Inheritance diagram for cv::SparseMatConstIterator:

List of all members.

## Public Member Functions
const SparseMat::Node * | node () const
| returns the current node of the sparse matrix. it.node->idx is the current element index
SparseMatConstIterator & | operator++ ()
| moves iterator to the next element
SparseMatConstIterator | operator++ (int)
| moves iterator to the next element
SparseMatConstIterator | operator-- (int)
| moves iterator to the previous element
SparseMatConstIterator & | operator-- ()
| 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
| 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
template<typename _Tp >
const _Tp & | value () const
| template method returning the current matrix element
## Public Attributes
size_t | hashidx
const SparseMat * | m
uchar * | ptr

## 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

cv::SparseMatConstIterator::SparseMatConstIterator | ( | ) | `[inline]`

the default constructor

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

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

cv::SparseMatConstIterator::SparseMatConstIterator | ( | const SparseMatConstIterator & | it ) | `[inline]`

the copy constructor

## Member Function Documentation

const SparseMat::Node * cv::SparseMatConstIterator::node | ( | ) | const`[inline]`

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

Reimplemented in cv::SparseMatIterator.

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

moves iterator to the next element

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

SparseMatConstIterator cv::SparseMatConstIterator::operator++ | ( | int | ) | `[inline]`

moves iterator to the next element

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

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

moves iterator to the previous element

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

moves iterator to the previous element

SparseMatConstIterator & cv::SparseMatConstIterator::operator= | ( | const SparseMatConstIterator & | it ) | `[inline]`

the assignment operator

void cv::SparseMatConstIterator::seekEnd | ( | ) | `[inline]`

moves iterator to the element after the last element

template<typename _Tp >

const _Tp & cv::SparseMatConstIterator::value | ( | ) | const`[inline]`

template method returning the current matrix element

Reimplemented in cv::SparseMatIterator.

## Member Data Documentation

size_t cv::SparseMatConstIterator::hashidx

const SparseMat* cv::SparseMatConstIterator::m

uchar* cv::SparseMatConstIterator::ptr

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

- /usr/ports/pobj/OpenCV-2.2.0/OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp
- /usr/ports/pobj/OpenCV-2.2.0/OpenCV-2.2.0/modules/core/include/opencv2/core/mat.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines