OpenCV453
公開メンバ関数 | 公開変数類 | 全メンバ一覧
cv::SparseMatConstIterator クラス

Read-Only Sparse Matrix Iterator. [詳解]

#include <mat.hpp>

cv::SparseMatConstIterator_< _Tp >, cv::SparseMatIteratorに継承されています。

公開メンバ関数

 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
 

公開変数類

const SparseMatm
 
size_t hashidx
 
uchar * ptr
 

詳解

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>();
SparseMatConstIterator()
the default constructor
int type() const
returns type of sparse matrix elements
SparseMatIterator end()
returns the sparse matrix iterator at the matrix end
SparseMatIterator begin()
returns the sparse matrix iterator at the matrix beginning
#define CV_Assert(expr)
Checks a condition at runtime and throws exception if it fails
Definition: base.hpp:342

このクラス詳解は次のファイルから抽出されました: