9 #ifndef mrpt_matrix_adaptors_H 10 #define mrpt_matrix_adaptors_H 21 template <
typename T,
typename U,
bool UIsObject>
22 class CBinaryRelation;
30 template <
typename U,
bool B>
47 template <
typename T,
typename U,
bool UIsObject,
typename FunctionType>
50 const T& T1,
const T& T2);
58 template <
typename A,
typename T>
137 template <
typename A,
typename T>
221 template <
typename MAT>
234 ASSERT_(rowIdx < mat.getRowCount())
275 inline size_t size()
const {
return m_mat->getColCount(); }
279 throw std::logic_error(
"Tried to resize a fixed-size vector");
282 template <
typename MAT>
309 MAT& mat,
size_t row,
size_t offset,
size_t space)
360 throw std::logic_error(
"Tried to resize a fixed-size vector");
363 template <
typename MAT>
365 MAT& m,
size_t rowIdx,
size_t offset,
size_t space = 1)
416 inline size_t size()
const {
return m_mat->getColCount(); }
420 throw std::logic_error(
"Tried to resize a fixed-size vector");
423 template <
typename MAT>
450 const MAT& mat,
size_t row,
size_t offset,
size_t space)
484 throw std::logic_error(
"Tried to resize a fixed-size vector");
487 template <
typename MAT>
489 const MAT& m,
size_t rowIdx,
size_t offset,
size_t space = 1)
499 template <
typename MAT>
512 ASSERT_(colIdx < mat.getColCount())
554 inline size_t size()
const {
return m_mat->getRowCount(); }
558 throw std::logic_error(
"Tried to resize a fixed-size vector");
561 template <
typename MAT>
572 template <
typename MAT>
586 MAT& mat,
size_t col,
size_t offset,
size_t space)
592 ASSERT_(col < mat.getColCount());
637 throw std::logic_error(
"Tried to resize a fixed-size vector");
640 template <
typename MAT>
642 MAT& m,
size_t colIdx,
size_t offset,
size_t space = 1)
665 ASSERT_(colIdx < mat.getColCount());
691 inline size_t size()
const {
return m_mat->getRowCount(); }
695 throw std::logic_error(
"Tried to resize a fixed-size vector");
698 template <
typename MAT>
700 const MAT& m,
size_t colIdx)
710 template <
typename MAT>
724 const MAT& mat,
size_t col,
size_t offset,
size_t space)
730 ASSERT_(col < mat.getColCount());
758 throw std::logic_error(
"Tried to resize a fixed-size vector");
761 template <
typename MAT>
763 const MAT& m,
size_t colIdx,
size_t offset,
size_t space = 1)
CMatrixColumnAccessor< MAT > mrpt_autotype
CMatrixColumnAccessorExtended< MAT > mrpt_autotype
detail::ReverseAccessorIterator< const CMatrixRowAccessor< MAT >, const value_type > const_reverse_iterator
bool operator==(const AccessorIterator< A, T > &it) const
CConstMatrixRowAccessor()
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] opera...
void applyFunction(CBinaryRelation< T, U, UIsObject > &o, FunctionType fun, size_t e1, size_t e2, const T &T1, const T &T2)
const_iterator begin() const
CMatrixRowAccessor< MAT > mrpt_autotype
value_type & operator[](size_t i)
CMatrixColumnAccessor(MAT &mat, size_t colIdx)
This template is a trick to switch the type of a variable using a boolean variable in the template...
CMatrixRowAccessorExtended()
CConstMatrixRowAccessorExtended(const MAT &mat, size_t row, size_t offset, size_t space)
const_reverse_iterator rbegin() const
const_reverse_iterator rbegin() const
detail::ReverseAccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > reverse_iterator
const_reverse_iterator rbegin() const
ReverseAccessorIterator(A &obj, size_t N)
value_type operator[](const size_t i) const
reverse_iterator rbegin()
detail::ReverseAccessorIterator< CMatrixRowAccessor< MAT >, value_type > reverse_iterator
int operator-(const AccessorIterator< A, T > &it) const
const_reverse_iterator rbegin() const
CConstMatrixColumnAccessor< MAT > mrpt_autotype
value_type & operator[](const size_t i)
const_reverse_iterator rend() const
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator...
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator...
const_iterator end() const
const_iterator begin() const
AccessorIterator< A, T > operator++(int)
This class models a binary relation through the elements of any given set.
ReverseAccessorIterator< A, T > operator--(int)
ReverseAccessorIterator< A, T > operator++(int)
detail::AccessorIterator< CMatrixRowAccessor< MAT >, value_type > iterator
CMatrixTemplate< U > MatrixType
const_iterator begin() const
detail::AccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > iterator
AccessorIterator< A, T > & operator+=(int off)
detail::ReverseAccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
const_iterator begin() const
GLsizei GLsizei GLuint * obj
value_type operator[](size_t i) const
detail::AccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_iterator
const_reverse_iterator rbegin() const
detail::ReverseAccessorIterator< const CConstMatrixRowAccessor< MAT >, const value_type > const_reverse_iterator
const_iterator end() const
detail::ReverseAccessorIterator< CMatrixColumnAccessor< MAT >, value_type > reverse_iterator
const_iterator begin() const
const_reverse_iterator rend() const
detail::AccessorIterator< const CConstMatrixRowAccessor< MAT >, const value_type > const_iterator
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator...
detail::ReverseAccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > reverse_iterator
detail::AccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_iterator
const_reverse_iterator rend() const
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
detail::AccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
const_reverse_iterator rbegin() const
CMatrixRowAccessor< MAT > getRowAccessor(MAT &m, size_t rowIdx)
AccessorIterator< A, T > & operator--()
const_reverse_iterator rend() const
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator...
CMatrixRowAccessorExtended(MAT &mat, size_t row, size_t offset, size_t space)
const_reverse_iterator rbegin() const
detail::AccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > iterator
T & operator[](int off) const
int operator-(const ReverseAccessorIterator< A, T > &it) const
value_type operator[](size_t i) const
CConstMatrixRowAccessor< MAT > mrpt_autotype
bool operator!=(const AccessorIterator< A, T > &it) const
detail::AccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
const_iterator begin() const
detail::ReverseAccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
CMatrixRowAccessorExtended< MAT > mrpt_autotype
AccessorIterator< A, T > operator-(int off) const
bool operator!=(const ReverseAccessorIterator< A, T > &it) const
ReverseAccessorIterator< A, T > & operator+=(int off)
value_type operator[](size_t i) const
CConstMatrixColumnAccessorExtended(const MAT &mat, size_t col, size_t offset, size_t space)
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator...
reverse_iterator rbegin()
std::random_access_iterator_tag iterator_category
reverse_iterator rbegin()
const_iterator begin() const
value_type operator[](size_t i) const
ReverseAccessorIterator< A, T > & operator++()
ReverseAccessorIterator< A, T > & operator--()
CConstMatrixRowAccessor(const MAT &mat, size_t row)
const_iterator begin() const
CConstMatrixColumnAccessor(const MAT &mat, size_t colIdx)
CConstMatrixColumnAccessor()
This template class provides the basic functionality for a general 2D any-size, resizable container o...
const_iterator end() const
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
detail::AccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
const_reverse_iterator rend() const
CMatrixTemplateObjects< U > MatrixType
CConstMatrixRowAccessorExtended< MAT > mrpt_autotype
Template class for matrix accessor's iterators.
T & operator[](int off) const
CMatrixColumnAccessorExtended< MAT > mrpt_autotype
AccessorIterator< A, T > & operator++()
const_reverse_iterator rend() const
GLenum GLenum GLvoid * row
CMatrixColumnAccessor< MAT > getColumnAccessor(MAT &m, size_t colIdx)
const_iterator end() const
AccessorIterator< A, T > operator-(int off) const
detail::ReverseAccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
value_type operator[](size_t i) const
const_reverse_iterator rbegin() const
detail::AccessorIterator< CMatrixColumnAccessor< MAT >, value_type > iterator
value_type & operator[](const size_t i)
ReverseAccessorIterator< A, T > operator+(int off) const
detail::AccessorIterator< const CMatrixRowAccessor< MAT >, const value_type > const_iterator
AccessorIterator(A &obj, size_t N)
CMatrixColumnAccessorExtended(MAT &mat, size_t col, size_t offset, size_t space)
AccessorIterator< A, T > operator+(int off) const
CConstMatrixRowAccessorExtended()
const_iterator end() const
CConstMatrixColumnAccessorExtended()
const_reverse_iterator rend() const
Template class for matrix accessor's iterators.
value_type operator[](size_t i) const
CMatrixColumnAccessorExtended()
AccessorIterator< A, T > operator--(int)
const_reverse_iterator rend() const
const_iterator end() const
AccessorIterator< A, T > & operator-=(int off)
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator...
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
reverse_iterator rbegin()
std::random_access_iterator_tag iterator_category
This template class extends the class "CMatrixTemplate" for storing "objects" at each matrix entry...
const_iterator end() const
AccessorIterator< A, T > & operator-=(int off)
const_iterator end() const
bool operator==(const ReverseAccessorIterator< A, T > &it) const
detail::AccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
detail::ReverseAccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
value_type operator[](const size_t i) const
value_type & operator[](size_t i)
CMatrixRowAccessor(MAT &mat, size_t rowIdx)
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] opera...