#include <core.hpp>
Public Types | |
typedef SparseMatConstIterator_< _Tp > | const_iterator |
typedef SparseMatIterator_< _Tp > | iterator |
Public Member Functions | |
SparseMatConstIterator_< _Tp > | begin () const |
returns read-only sparse matrix iterator pointing to the first sparse matrix element | |
SparseMatIterator_< _Tp > | begin () |
returns sparse matrix iterator pointing to the first sparse matrix element | |
int | channels () const |
returns the number of channels in each matrix element | |
SparseMat_ | clone () const |
makes full copy of the matrix. All the elements are duplicated | |
void | create (int dims, const int *_sizes) |
equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type) | |
int | depth () const |
returns depth of the matrix elements | |
SparseMatConstIterator_< _Tp > | end () const |
returns read-only sparse matrix iterator pointing to the element following the last sparse matrix element | |
SparseMatIterator_< _Tp > | end () |
returns sparse matrix iterator pointing to the element following the last sparse matrix element | |
operator CvSparseMat * () const | |
converts sparse matrix to the old-style CvSparseMat. All the elements are copied | |
_Tp | operator() (const int *idx, size_t *hashval=0) const |
equivalent to SparseMat::value<_Tp>(idx, hashval) | |
_Tp | operator() (int i0, int i1, int i2, size_t *hashval=0) const |
equivalent to SparseMat::value<_Tp>(i0, i1, i2, hashval) | |
_Tp | operator() (int i0, int i1, size_t *hashval=0) const |
equivalent to SparseMat::value<_Tp>(i0, i1, hashval) | |
_Tp | operator() (int i0, size_t *hashval=0) const |
equivalent to SparseMat::value<_Tp>(i0, hashval) | |
SparseMat_ & | operator= (const Mat &m) |
converts dense matrix to the sparse form | |
SparseMat_ & | operator= (const SparseMat_ &m) |
the assignment operator. This is O(1) operation - no data is copied | |
SparseMat_ & | operator= (const SparseMat &m) |
the assignment operator. If DataType<_Tp>.type != m.type(), the m elements are converted | |
_Tp & | ref (const int *idx, size_t *hashval=0) |
equivalent to SparseMat::ref<_Tp>(idx, hashval) | |
_Tp & | ref (int i0, int i1, int i2, size_t *hashval=0) |
equivalent to SparseMat::ref<_Tp>(i0, i1, i2, hashval) | |
_Tp & | ref (int i0, int i1, size_t *hashval=0) |
equivalent to SparseMat::ref<_Tp>(i0, i1, hashval) | |
_Tp & | ref (int i0, size_t *hashval=0) |
equivalent to SparseMat::ref<_Tp>(i0, hashval) | |
SparseMat_ (const CvSparseMat *m) | |
converts the old-style sparse matrix to the C++ class. All the elements are copied | |
SparseMat_ (const Mat &m) | |
converts dense matrix to the sparse form | |
SparseMat_ (const SparseMat_ &m) | |
the copy constructor. This is O(1) operation - no data is copied | |
SparseMat_ (const SparseMat &m) | |
the copy constructor. If DataType<_Tp>.type != m.type(), the m elements are converted | |
SparseMat_ (int dims, const int *_sizes) | |
the full constructor equivelent to SparseMat(dims, _sizes, DataType<_Tp>::type) | |
SparseMat_ () | |
the default constructor | |
int | type () const |
returns type of the matrix elements |
The Template Sparse Matrix class derived from cv::SparseMat
The class provides slightly more convenient operations for accessing elements.
SparseMat m; ... SparseMat_<int> m_ = (SparseMat_<int>&)m; m_.ref(1)++; // equivalent to m.ref<int>(1)++; m_.ref(2) += m_(3); // equivalent to m.ref<int>(2) += m.value<int>(3);
typedef SparseMatConstIterator_<_Tp> cv::SparseMat_< _Tp >::const_iterator |
Reimplemented from cv::SparseMat.
typedef SparseMatIterator_<_Tp> cv::SparseMat_< _Tp >::iterator |
Reimplemented from cv::SparseMat.
cv::SparseMat_< _Tp >::SparseMat_ | ( | ) | [inline] |
the default constructor
cv::SparseMat_< _Tp >::SparseMat_ | ( | int | dims, | |
const int * | _sizes | |||
) | [inline] |
the full constructor equivelent to SparseMat(dims, _sizes, DataType<_Tp>::type)
cv::SparseMat_< _Tp >::SparseMat_ | ( | const SparseMat & | m | ) | [inline] |
the copy constructor. If DataType<_Tp>.type != m.type(), the m elements are converted
cv::SparseMat_< _Tp >::SparseMat_ | ( | const SparseMat_< _Tp > & | m | ) | [inline] |
the copy constructor. This is O(1) operation - no data is copied
cv::SparseMat_< _Tp >::SparseMat_ | ( | const Mat & | m | ) | [inline] |
converts dense matrix to the sparse form
cv::SparseMat_< _Tp >::SparseMat_ | ( | const CvSparseMat * | m | ) | [inline] |
converts the old-style sparse matrix to the C++ class. All the elements are copied
SparseMatConstIterator_< _Tp > cv::SparseMat_< _Tp >::begin | ( | ) | const [inline] |
returns read-only sparse matrix iterator pointing to the first sparse matrix element
Reimplemented from cv::SparseMat.
SparseMatIterator_< _Tp > cv::SparseMat_< _Tp >::begin | ( | ) | [inline] |
returns sparse matrix iterator pointing to the first sparse matrix element
Reimplemented from cv::SparseMat.
int cv::SparseMat_< _Tp >::channels | ( | ) | const [inline] |
returns the number of channels in each matrix element
Reimplemented from cv::SparseMat.
SparseMat_< _Tp > cv::SparseMat_< _Tp >::clone | ( | ) | const [inline] |
makes full copy of the matrix. All the elements are duplicated
Reimplemented from cv::SparseMat.
void cv::SparseMat_< _Tp >::create | ( | int | dims, | |
const int * | _sizes | |||
) | [inline] |
equivalent to cv::SparseMat::create(dims, _sizes, DataType<_Tp>::type)
int cv::SparseMat_< _Tp >::depth | ( | ) | const [inline] |
returns depth of the matrix elements
Reimplemented from cv::SparseMat.
SparseMatConstIterator_< _Tp > cv::SparseMat_< _Tp >::end | ( | ) | const [inline] |
returns read-only sparse matrix iterator pointing to the element following the last sparse matrix element
Reimplemented from cv::SparseMat.
SparseMatIterator_< _Tp > cv::SparseMat_< _Tp >::end | ( | ) | [inline] |
returns sparse matrix iterator pointing to the element following the last sparse matrix element
Reimplemented from cv::SparseMat.
cv::SparseMat_< _Tp >::operator CvSparseMat * | ( | ) | const [inline] |
converts sparse matrix to the old-style CvSparseMat. All the elements are copied
Reimplemented from cv::SparseMat.
_Tp cv::SparseMat_< _Tp >::operator() | ( | const int * | idx, | |
size_t * | hashval = 0 | |||
) | const [inline] |
equivalent to SparseMat::value<_Tp>(idx, hashval)
_Tp cv::SparseMat_< _Tp >::operator() | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
size_t * | hashval = 0 | |||
) | const [inline] |
equivalent to SparseMat::value<_Tp>(i0, i1, i2, hashval)
_Tp cv::SparseMat_< _Tp >::operator() | ( | int | i0, | |
int | i1, | |||
size_t * | hashval = 0 | |||
) | const [inline] |
equivalent to SparseMat::value<_Tp>(i0, i1, hashval)
_Tp cv::SparseMat_< _Tp >::operator() | ( | int | i0, | |
size_t * | hashval = 0 | |||
) | const [inline] |
equivalent to SparseMat::value<_Tp>(i0, hashval)
SparseMat_< _Tp > & cv::SparseMat_< _Tp >::operator= | ( | const Mat & | m | ) | [inline] |
converts dense matrix to the sparse form
Reimplemented from cv::SparseMat.
SparseMat_< _Tp > & cv::SparseMat_< _Tp >::operator= | ( | const SparseMat_< _Tp > & | m | ) | [inline] |
the assignment operator. This is O(1) operation - no data is copied
SparseMat_< _Tp > & cv::SparseMat_< _Tp >::operator= | ( | const SparseMat & | m | ) | [inline] |
the assignment operator. If DataType<_Tp>.type != m.type(), the m elements are converted
Reimplemented from cv::SparseMat.
_Tp & cv::SparseMat_< _Tp >::ref | ( | const int * | idx, | |
size_t * | hashval = 0 | |||
) | [inline] |
equivalent to SparseMat::ref<_Tp>(idx, hashval)
Reimplemented from cv::SparseMat.
_Tp & cv::SparseMat_< _Tp >::ref | ( | int | i0, | |
int | i1, | |||
int | i2, | |||
size_t * | hashval = 0 | |||
) | [inline] |
equivalent to SparseMat::ref<_Tp>(i0, i1, i2, hashval)
Reimplemented from cv::SparseMat.
_Tp & cv::SparseMat_< _Tp >::ref | ( | int | i0, | |
int | i1, | |||
size_t * | hashval = 0 | |||
) | [inline] |
equivalent to SparseMat::ref<_Tp>(i0, i1, hashval)
Reimplemented from cv::SparseMat.
_Tp & cv::SparseMat_< _Tp >::ref | ( | int | i0, | |
size_t * | hashval = 0 | |||
) | [inline] |
equivalent to SparseMat::ref<_Tp>(i0, hashval)
Reimplemented from cv::SparseMat.
int cv::SparseMat_< _Tp >::type | ( | ) | const [inline] |
returns type of the matrix elements
Reimplemented from cv::SparseMat.