9 #ifndef mrpt_matrix_adaptors_H
10 #define mrpt_matrix_adaptors_H
22 template<
typename T,
typename U,
bool UIsObject>
class CBinaryRelation;
41 template<
typename T,
typename U,
bool UIsObject,
typename FunctionType>
inline void applyFunction(
CBinaryRelation<T,U,UIsObject> &o, FunctionType fun,
size_t e1,
size_t e2,
const T &T1,
const T &T2);
190 template <
typename MAT>
232 return m_mat->getColCount();
235 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
258 ASSERT_(row<mat.getRowCount());
300 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
320 ASSERT_(row<mat.getRowCount());
341 return m_mat->getColCount();
344 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
367 ASSERT_(row<mat.getRowCount());
392 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
443 return m_mat->getRowCount();
446 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
456 template<
typename MAT>
468 ASSERT_(col<mat.getColCount());
510 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
529 ASSERT_(colIdx<mat.getColCount());
550 return m_mat->getRowCount();
553 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
563 template<
typename MAT>
575 ASSERT_(col<mat.getColCount());
600 if (N!=
size())
throw std::logic_error(
"Tried to resize a fixed-size vector");
This class models a binary relation through the elements of any given set.
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] opera...
const_iterator begin() const
const_iterator end() const
const_reverse_iterator rend() const
detail::AccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
value_type operator[](size_t i) const
CConstMatrixColumnAccessorExtended()
const_reverse_iterator rbegin() const
CMatrixColumnAccessorExtended< MAT > mrpt_autotype
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
CConstMatrixColumnAccessorExtended(const MAT &mat, size_t col, size_t offset, size_t space)
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] opera...
detail::AccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_iterator
value_type operator[](size_t i) const
const_iterator end() const
CConstMatrixColumnAccessor()
const_reverse_iterator rend() const
const_iterator begin() const
const_reverse_iterator rbegin() const
CConstMatrixColumnAccessor(const MAT &mat, size_t colIdx)
CConstMatrixColumnAccessor< MAT > mrpt_autotype
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator...
CConstMatrixRowAccessorExtended()
const_reverse_iterator rbegin() const
detail::AccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
const_reverse_iterator rend() const
detail::ReverseAccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
CConstMatrixRowAccessorExtended< MAT > mrpt_autotype
const_iterator begin() const
CConstMatrixRowAccessorExtended(const MAT &mat, size_t row, size_t offset, size_t space)
value_type operator[](size_t i) const
const_iterator end() const
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator...
detail::ReverseAccessorIterator< const CConstMatrixRowAccessor< MAT >, const value_type > const_reverse_iterator
CConstMatrixRowAccessor()
CConstMatrixRowAccessor< MAT > mrpt_autotype
const_reverse_iterator rbegin() const
value_type operator[](size_t i) const
const_iterator end() const
const_iterator begin() const
CConstMatrixRowAccessor(const MAT &mat, size_t row)
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 column with a [] operator,...
detail::AccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > iterator
value_type & operator[](size_t i)
detail::AccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
const_reverse_iterator rend() const
detail::ReverseAccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
detail::ReverseAccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > reverse_iterator
const_iterator end() const
CMatrixColumnAccessorExtended< MAT > mrpt_autotype
CMatrixColumnAccessorExtended()
const_iterator begin() const
reverse_iterator rbegin()
value_type operator[](size_t i) const
CMatrixColumnAccessorExtended(MAT &mat, size_t col, size_t offset, size_t space)
const_reverse_iterator rbegin() const
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator.
const_iterator end() const
detail::AccessorIterator< CMatrixColumnAccessor< MAT >, value_type > iterator
detail::ReverseAccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
value_type operator[](const size_t i) const
detail::ReverseAccessorIterator< CMatrixColumnAccessor< MAT >, value_type > reverse_iterator
detail::AccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_iterator
value_type & operator[](const size_t i)
CMatrixColumnAccessor< MAT > mrpt_autotype
const_reverse_iterator rend() const
const_iterator begin() const
const_reverse_iterator rbegin() const
reverse_iterator rbegin()
CMatrixColumnAccessor(MAT &mat, size_t colIdx)
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator,...
detail::AccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > iterator
CMatrixRowAccessorExtended< MAT > mrpt_autotype
detail::ReverseAccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
const_iterator begin() const
value_type operator[](size_t i) const
detail::ReverseAccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > reverse_iterator
value_type & operator[](size_t i)
const_iterator end() const
const_reverse_iterator rend() const
CMatrixRowAccessorExtended(MAT &mat, size_t row, size_t offset, size_t space)
reverse_iterator rbegin()
detail::AccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
const_reverse_iterator rbegin() const
CMatrixRowAccessorExtended()
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator.
const_reverse_iterator rend() const
const_reverse_iterator rbegin() const
reverse_iterator rbegin()
CMatrixRowAccessor(MAT &mat, size_t rowIdx)
detail::AccessorIterator< const CMatrixRowAccessor< MAT >, const value_type > const_iterator
CMatrixRowAccessor< MAT > mrpt_autotype
detail::AccessorIterator< CMatrixRowAccessor< MAT >, value_type > iterator
value_type operator[](const size_t i) const
const_iterator begin() const
detail::ReverseAccessorIterator< const CMatrixRowAccessor< MAT >, const value_type > const_reverse_iterator
const_iterator end() const
detail::ReverseAccessorIterator< CMatrixRowAccessor< MAT >, value_type > reverse_iterator
value_type & operator[](const size_t i)
This template class provides the basic functionality for a general 2D any-size, resizable container o...
This template class extends the class "CMatrixTemplate" for storing "objects" at each matrix entry.
Template class for matrix accessor's iterators.
AccessorIterator< A, T > & operator+=(int off)
AccessorIterator(A &obj, size_t N)
bool operator==(const AccessorIterator< A, T > &it) const
AccessorIterator< A, T > & operator--()
AccessorIterator< A, T > operator--(int)
T & operator[](int off) const
AccessorIterator< A, T > & operator++()
AccessorIterator< A, T > operator+(int off) const
AccessorIterator< A, T > & operator-=(int off)
AccessorIterator< A, T > operator-(int off) const
AccessorIterator< A, T > operator++(int)
std::random_access_iterator_tag iterator_category
bool operator!=(const AccessorIterator< A, T > &it) const
int operator-(const AccessorIterator< A, T > &it) const
CMatrixTemplate< U > MatrixType
CMatrixTemplateObjects< U > MatrixType
This template is a trick to switch the type of a variable using a boolean variable in the template.
Template class for matrix accessor's iterators.
ReverseAccessorIterator< A, T > operator+(int off) const
bool operator==(const ReverseAccessorIterator< A, T > &it) const
ReverseAccessorIterator(A &obj, size_t N)
std::random_access_iterator_tag iterator_category
ReverseAccessorIterator< A, T > & operator++()
T & operator[](int off) const
ReverseAccessorIterator< A, T > operator++(int)
AccessorIterator< A, T > operator-(int off) const
ReverseAccessorIterator< A, T > & operator--()
ReverseAccessorIterator< A, T > & operator+=(int off)
int operator-(const ReverseAccessorIterator< A, T > &it) const
AccessorIterator< A, T > & operator-=(int off)
bool operator!=(const ReverseAccessorIterator< A, T > &it) const
ReverseAccessorIterator< A, T > operator--(int)
void applyFunction(CBinaryRelation< T, U, UIsObject > &o, FunctionType fun, size_t e1, size_t e2, const T &T1, const T &T2)
CMatrixRowAccessor< MAT > getRowAccessor(MAT &m, size_t rowIdx)
CMatrixColumnAccessor< MAT > getColumnAccessor(MAT &m, size_t colIdx)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.