MRPT  1.9.9
matrix_adaptors.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/math/math_frwds.h> // forward declarations
12 
13 namespace mrpt
14 {
15 namespace math
16 {
17 /** Internal classes not to be directly used by the user. */
18 // Forward declarations:
19 template <typename T, typename U, bool UIsObject>
20 class CBinaryRelation;
21 namespace detail
22 {
23 /**
24  * This template is a trick to switch the type of a variable using a boolean
25  * variable in the template. It's easy to extend its functionality to several
26  * types, using a unsigned char instead of a bool.
27  */
28 template <typename U, bool B>
30 
31 // partial specializations:
32 template <typename U>
33 class MatrixWrapper<U, true>
34 {
35  public:
36  using MatrixType = CMatrixTemplateObjects<U>;
37 };
38 template <typename U>
39 class MatrixWrapper<U, false>
40 {
41  public:
43 };
44 
45 template <typename T, typename U, bool UIsObject, typename FunctionType>
46 inline void applyFunction(
47  CBinaryRelation<T, U, UIsObject>& o, FunctionType fun, size_t e1, size_t e2,
48  const T& T1, const T& T2);
49 } // namespace detail
50 
51 namespace detail
52 {
53 /** Template class for matrix accessor's iterators.
54  * \sa CMatrixRowAccessor,CMatrixColumnAccessor
55  */
56 template <typename A, typename T>
58 {
59  protected:
60  A* base;
61  int pos;
62 
63  public:
64  // typedefs for iterator_traits:
65  using iterator_category = std::random_access_iterator_tag;
66  using value_type = T;
67  using difference_type = int;
68  using pointer = T*;
69  using reference = T&;
70 
71  inline AccessorIterator(A& obj, size_t N) : base(&obj), pos(N) {}
72  inline T& operator*() const { return (*base)[pos]; }
74  {
75  ++pos;
76  return *this;
77  }
79  {
80  AccessorIterator<A, T> it = *this;
81  ++*this;
82  return it;
83  }
85  {
86  --pos;
87  return *this;
88  }
90  {
91  AccessorIterator<A, T> it = *this;
92  --*this;
93  return it;
94  }
96  {
97  pos += off;
98  return *this;
99  }
100  inline AccessorIterator<A, T> operator+(int off) const
101  {
102  AccessorIterator<A, T> it = *this;
103  it += off;
104  return it;
105  }
107  {
108  pos -= off;
109  return *this;
110  }
111  inline AccessorIterator<A, T> operator-(int off) const
112  {
113  AccessorIterator<A, T> it = *this;
114  it -= off;
115  return it;
116  }
117  inline int operator-(const AccessorIterator<A, T>& it) const
118  {
119  return pos - it.pos;
120  }
121  inline T& operator[](int off) const { return (*base)[pos + off]; }
122  inline bool operator==(const AccessorIterator<A, T>& it) const
123  {
124  return (pos == it.pos) && (base == it.base);
125  }
126  inline bool operator!=(const AccessorIterator<A, T>& it) const
127  {
128  return !(operator==(it));
129  }
130 };
131 
132 /** Template class for matrix accessor's iterators.
133  * \sa CMatrixRowAccessor,CMatrixColumnAccessor
134  */
135 template <typename A, typename T>
137 {
138  protected:
139  A* base;
140  int pos;
141 
142  public:
143  // typedefs for iterator_traits:
144  using iterator_category = std::random_access_iterator_tag;
145  using value_type = T;
146  using difference_type = int;
147  using pointer = T*;
148  using reference = T&;
149 
150  inline ReverseAccessorIterator(A& obj, size_t N) : base(&obj), pos(N) {}
151  inline T& operator*() const { return (*base)[pos]; }
153  {
154  --pos;
155  return *this;
156  }
158  {
160  ++*this; // Yes, that's right.
161  return it;
162  }
164  {
165  ++pos;
166  return *this;
167  }
169  {
171  --*this; // Yes, that's right.
172  return it;
173  }
175  {
176  pos -= off;
177  return *this;
178  }
180  {
182  it += off; // Yes, that's right.
183  return it;
184  }
186  {
187  pos += off;
188  return *this;
189  }
190  inline AccessorIterator<A, T> operator-(int off) const
191  {
193  it -= off; // Yes, that's right
194  return it;
195  }
196  inline int operator-(const ReverseAccessorIterator<A, T>& it) const
197  {
198  return it.pos - pos;
199  }
200  inline T& operator[](int off) const { return (*base)[pos - off]; }
201  inline bool operator==(const ReverseAccessorIterator<A, T>& it) const
202  {
203  return (pos == it.pos) && (&base == &it.base);
204  }
205  inline bool operator!=(const ReverseAccessorIterator<A, T>& it) const
206  {
207  return !(operator==(it));
208  }
209 };
210 } // namespace detail
211 
212 /** A vector-like wrapper for a Matrix for accessing the elements of a given row
213  * with a [] operator.
214  * For usage with MRPT's CMatrixDynamic only (for MRPT numeric matrices, use
215  * Eigen methods)
216  * \sa
217  * CMatrixColumnAccessor,CMatrixRowAccessorExtended,CConstMatrixRowAccessor,CConstMatrixRowAccessorExtended
218  */
219 template <typename MAT>
221 {
222  protected:
223  MAT* m_mat;
224  size_t m_rowInd;
225 
226  public:
227  using value_type = typename MAT::Scalar;
229  inline CMatrixRowAccessor(MAT& mat, size_t rowIdx)
230  : m_mat(&mat), m_rowInd(rowIdx)
231  {
232  ASSERT_(rowIdx < mat.rows();
233  }
234  inline CMatrixRowAccessor() {}
235  inline value_type& operator[](const size_t i)
236  {
237  return (*m_mat)(m_rowInd, i);
238  }
239  inline value_type operator[](const size_t i) const
240  {
241  return (*m_mat)(m_rowInd, i);
242  }
243  using iterator =
247  using reverse_iterator =
251  inline iterator begin() { return iterator(*this, 0); }
252  inline const_iterator begin() const { return const_iterator(*this, 0); }
253  inline iterator end() { return iterator(*this, m_mat->cols()); }
254  inline const_iterator end() const
255  {
256  return const_iterator(*this, m_mat->cols());
257  }
259  {
260  return reverse_iterator(*this, m_mat->cols() - 1);
261  }
263  {
264  return const_reverse_iterator(*this, m_mat->cols() - 1);
265  }
266  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
268  {
269  return const_reverse_iterator(*this, -1);
270  }
271  inline size_t size() const { return m_mat->cols(); }
272  inline void resize(size_t N)
273  {
274  if (N != size())
275  throw std::logic_error("Tried to resize a fixed-size vector");
276  }
277 };
278 template <typename MAT>
279 inline CMatrixRowAccessor<MAT> getRowAccessor(MAT& m, size_t rowIdx)
280 {
281  return CMatrixRowAccessor<MAT>(m, rowIdx);
282 }
283 
284 /** A vector-like wrapper for a Matrix for accessing the elements of a given row
285  * with a [] operator, with offset and custom spacing.
286  * For usage with MRPT's CMatrixDynamic only (for MRPT numeric matrices, use
287  * Eigen methods)
288  * \sa
289  * CMatrixColumnAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessor,CConstMatrixRowAccessorExtended
290  */
291 template <class MAT>
293 {
294  protected:
295  MAT* m_mat;
296  size_t m_rowInd;
297  size_t m_colOffset;
299  size_t howMany;
300 
301  public:
302  using value_type = typename MAT::Scalar;
305  MAT& mat, size_t row, size_t offset, size_t space)
306  : m_mat(&mat),
307  m_rowInd(row),
308  m_colOffset(offset),
309  m_elementsSpace(space)
310  {
311  ASSERT_(row < mat.rows());
312  howMany = (mat.cols() - m_colOffset) / m_elementsSpace;
313  }
315  inline value_type& operator[](size_t i)
316  {
317  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
318  }
319  inline value_type operator[](size_t i) const
320  {
321  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
322  }
323  using iterator =
331  inline iterator begin() { return iterator(*this, 0); }
332  inline const_iterator begin() const { return const_iterator(*this, 0); }
333  inline iterator end() { return iterator(*this, howMany); }
334  inline const_iterator end() const { return const_iterator(*this, howMany); }
336  {
337  return reverse_iterator(*this, howMany - 1);
338  }
340  {
341  return const_reverse_iterator(*this, howMany - 1);
342  }
343  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
345  {
346  return const_reverse_iterator(*this, -1);
347  }
348  inline size_t size() const { return howMany; }
349  inline void resize(size_t N)
350  {
351  if (N != size())
352  throw std::logic_error("Tried to resize a fixed-size vector");
353  }
354 };
355 template <typename MAT>
357  MAT& m, size_t rowIdx, size_t offset, size_t space = 1)
358 {
359  return CMatrixRowAccessor<MAT>(m, rowIdx, offset, space);
360 }
361 
362 /** A vector-like wrapper for a const Matrix for accessing the elements of a
363  * given row with a [] operator.
364  * For usage with MRPT's CMatrixDynamic only (for MRPT numeric matrices, use
365  * Eigen methods)
366  * \sa
367  * CConstMatrixColumnAccessor,CMatrixRowAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessorExtended
368  */
369 template <class MAT>
371 {
372  protected:
373  const MAT* m_mat;
374  size_t m_rowInd;
375 
376  public:
377  using value_type = typename MAT::Scalar;
379  inline CConstMatrixRowAccessor(const MAT& mat, size_t row)
380  : m_mat(&mat), m_rowInd(row)
381  {
382  ASSERT_(row < mat.rows());
383  }
385  inline value_type operator[](size_t i) const
386  {
387  return (*m_mat)(m_rowInd, i);
388  }
393  inline const_iterator begin() const { return const_iterator(*this, 0); }
394  inline const_iterator end() const
395  {
396  return const_iterator(*this, m_mat->cols());
397  }
399  {
400  return const_reverse_iterator(*this, m_mat->cols() - 1);
401  }
403  {
404  return const_reverse_iterator(*this, -1);
405  }
406  inline size_t size() const { return m_mat->cols(); }
407  inline void resize(size_t N)
408  {
409  if (N != size())
410  throw std::logic_error("Tried to resize a fixed-size vector");
411  }
412 };
413 template <typename MAT>
414 inline CConstMatrixRowAccessor<MAT> getRowAccessor(const MAT& m, size_t rowIdx)
415 {
416  return CMatrixRowAccessor<MAT>(m, rowIdx);
417 }
418 
419 /** A vector-like wrapper for a const Matrix for accessing the elements of a
420  * given row with a [] operator, with offset and custom spacing.
421  * For usage with MRPT's CMatrixDynamic only (for MRPT numeric matrices, use
422  * Eigen methods)
423  * \sa
424  * CConstMatrixColumnAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessor,CMatrixRowAccessorExtended
425  */
426 template <class MAT>
428 {
429  protected:
430  const MAT* m_mat;
431  size_t m_rowInd;
432  size_t m_colOffset;
434  size_t howMany;
435 
436  public:
437  using value_type = typename MAT::Scalar;
440  const MAT& mat, size_t row, size_t offset, size_t space)
441  : m_mat(&mat),
442  m_rowInd(row),
443  m_colOffset(offset),
444  m_elementsSpace(space)
445  {
446  ASSERT_(row < mat.rows());
447  howMany = (mat.cols() - m_colOffset) / m_elementsSpace;
448  }
450  inline value_type operator[](size_t i) const
451  {
452  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
453  }
458  inline const_iterator begin() const { return const_iterator(*this, 0); }
459  inline const_iterator end() const { return const_iterator(*this, howMany); }
461  {
462  return const_reverse_iterator(*this, howMany - 1);
463  }
465  {
466  return const_reverse_iterator(*this, -1);
467  }
468  inline size_t size() const { return howMany; }
469  inline void resize(size_t N)
470  {
471  if (N != size())
472  throw std::logic_error("Tried to resize a fixed-size vector");
473  }
474 };
475 template <typename MAT>
477  const MAT& m, size_t rowIdx, size_t offset, size_t space = 1)
478 {
479  return CConstMatrixRowAccessorExtended<MAT>(m, rowIdx, offset, space);
480 }
481 
482 /** A vector-like wrapper for a Matrix for accessing the elements of a given
483  * column with a [] operator.
484  * \sa
485  * CMatrixRowAccessor,CMatrixColumnAccessorExtended,CConstMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
486  */
487 template <typename MAT>
489 {
490  protected:
491  MAT* m_mat;
492  size_t m_colInd;
493 
494  public:
495  using value_type = typename MAT::Scalar;
497  inline CMatrixColumnAccessor(MAT& mat, size_t colIdx)
498  : m_mat(&mat), m_colInd(colIdx)
499  {
500  ASSERT_(colIdx < mat.cols();
501  }
503  inline value_type& operator[](const size_t i)
504  {
505  return (*m_mat)(i, m_colInd);
506  }
507  inline value_type operator[](const size_t i) const
508  {
509  return (*m_mat)(i, m_colInd);
510  }
511  using iterator =
515  using reverse_iterator =
519  inline iterator begin() { return iterator(*this, 0); }
520  inline const_iterator begin() const { return const_iterator(*this, 0); }
521  inline iterator end() { return iterator(*this, m_mat->rows()); }
522  inline const_iterator end() const
523  {
524  return const_iterator(*this, m_mat->rows());
525  }
527  {
528  return reverse_iterator(*this, m_mat->rows() - 1);
529  }
531  {
532  return const_reverse_iterator(*this, m_mat->rows() - 1);
533  }
534  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
536  {
537  return const_reverse_iterator(*this, -1);
538  }
539  inline size_t size() const { return m_mat->rows(); }
540  inline void resize(size_t N)
541  {
542  if (N != size())
543  throw std::logic_error("Tried to resize a fixed-size vector");
544  }
545 };
546 template <typename MAT>
547 inline CMatrixColumnAccessor<MAT> getColumnAccessor(MAT& m, size_t colIdx)
548 {
549  return CMatrixColumnAccessor<MAT>(m, colIdx);
550 }
551 
552 /** A vector-like wrapper for a Matrix for accessing the elements of a given
553  * column with a [] operator, with offset and custom spacing.
554  * \sa
555  * CMatrixRowAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
556  */
557 template <typename MAT>
559 {
560  protected:
561  MAT* m_mat;
562  size_t m_colInd;
563  size_t m_rowOffset;
565  size_t howMany;
566 
567  public:
568  using value_type = typename MAT::Scalar;
571  MAT& mat, size_t col, size_t offset, size_t space)
572  : m_mat(&mat),
573  m_colInd(col),
574  m_rowOffset(offset),
575  m_elementsSpace(space)
576  {
577  ASSERT_(col < mat.cols());
578  howMany = (mat.rows() - m_rowOffset) / m_elementsSpace;
579  }
581  inline value_type& operator[](size_t i)
582  {
583  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
584  }
585  inline value_type operator[](size_t i) const
586  {
587  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
588  }
597  inline iterator begin() { return iterator(*this, 0); }
598  inline const_iterator begin() const { return const_iterator(*this, 0); }
599  inline iterator end() { return iterator(*this, howMany); }
600  inline const_iterator end() const { return const_iterator(*this, howMany); }
602  {
603  return reverse_iterator(*this, howMany - 1);
604  }
606  {
607  return const_reverse_iterator(*this, howMany - 1);
608  }
609  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
611  {
612  return const_reverse_iterator(*this, -1);
613  }
614  inline size_t size() const { return howMany; }
615  inline void resize(size_t N)
616  {
617  if (N != size())
618  throw std::logic_error("Tried to resize a fixed-size vector");
619  }
620 };
621 template <typename MAT>
623  MAT& m, size_t colIdx, size_t offset, size_t space = 1)
624 {
625  return CMatrixColumnAccessorExtended<MAT>(m, colIdx, offset, space);
626 }
627 
628 /** A vector-like wrapper for a const Matrix for accessing the elements of a
629  * given column with a [] operator.
630  * \sa
631  * CConstMatrixRowAccessor,CMatrixColumnAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
632  */
633 template <class MAT>
635 {
636  protected:
637  const MAT* m_mat;
638  size_t m_colInd;
639 
640  public:
641  using value_type = typename MAT::Scalar;
643  inline CConstMatrixColumnAccessor(const MAT& mat, size_t colIdx)
644  : m_mat(&mat), m_colInd(colIdx)
645  {
646  ASSERT_(colIdx < mat.cols());
647  }
649  inline value_type operator[](size_t i) const
650  {
651  return (*m_mat)(i, m_colInd);
652  }
657  inline const_iterator begin() const { return const_iterator(*this, 0); }
658  inline const_iterator end() const
659  {
660  return const_iterator(*this, m_mat->rows());
661  }
663  {
664  return const_reverse_iterator(*this, m_mat->rows() - 1);
665  }
667  {
668  return const_reverse_iterator(*this, -1);
669  }
670  inline size_t size() const { return m_mat->rows(); }
671  inline void resize(size_t N)
672  {
673  if (N != size())
674  throw std::logic_error("Tried to resize a fixed-size vector");
675  }
676 };
677 template <typename MAT>
679  const MAT& m, size_t colIdx)
680 {
681  return CConstMatrixColumnAccessor<MAT>(m, colIdx);
682 }
683 
684 /** A vector-like wrapper for a const Matrix for accessing the elements of a
685  * given column with a [] operator, with offset and custom spacing.
686  * \sa
687  * CConstMatrixRowAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessor,CMatrixColumnAccessorExtended
688  */
689 template <typename MAT>
691 {
692  protected:
693  const MAT* m_mat;
694  size_t m_colInd;
695  size_t m_rowOffset;
697  size_t howMany;
698 
699  public:
700  using value_type = typename MAT::Scalar;
703  const MAT& mat, size_t col, size_t offset, size_t space)
704  : m_mat(&mat),
705  m_colInd(col),
706  m_rowOffset(offset),
707  m_elementsSpace(space)
708  {
709  ASSERT_(col < mat.cols());
710  howMany = (mat.rows() - m_rowOffset) / m_elementsSpace;
711  }
713  inline value_type operator[](size_t i) const
714  {
715  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
716  }
721  inline const_iterator begin() const { return const_iterator(*this, 0); }
722  inline const_iterator end() const { return const_iterator(*this, howMany); }
724  {
725  return const_reverse_iterator(*this, howMany - 1);
726  }
728  {
729  return const_reverse_iterator(*this, -1);
730  }
731  inline size_t size() const { return howMany; }
732  inline void resize(size_t N)
733  {
734  if (N != size())
735  throw std::logic_error("Tried to resize a fixed-size vector");
736  }
737 };
738 template <typename MAT>
740  const MAT& m, size_t colIdx, size_t offset, size_t space = 1)
741 {
742  return CConstMatrixColumnAccessorExtended<MAT>(m, colIdx, offset, space);
743 }
744 
745 } // namespace math
746 } // namespace mrpt
detail::ReverseAccessorIterator< const CConstMatrixRowAccessor< MAT >, const value_type > const_reverse_iterator
bool operator==(const AccessorIterator< A, T > &it) const
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)
detail::AccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > iterator
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...
double Scalar
Definition: KmUtils.h:43
CConstMatrixRowAccessorExtended(const MAT &mat, size_t row, size_t offset, size_t space)
const_reverse_iterator rbegin() const
detail::ReverseAccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
const_reverse_iterator rbegin() const
value_type operator[](const size_t i) const
detail::ReverseAccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > reverse_iterator
int operator-(const AccessorIterator< A, T > &it) const
const_reverse_iterator rbegin() const
value_type & operator[](const size_t i)
A vector-like wrapper for a const Matrix for accessing the elements of a given row with a [] operator...
detail::AccessorIterator< CMatrixColumnAccessor< MAT >, value_type > iterator
A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator...
detail::ReverseAccessorIterator< CMatrixColumnAccessor< MAT >, value_type > reverse_iterator
AccessorIterator< A, T > operator++(int)
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
This class models a binary relation through the elements of any given set.
ReverseAccessorIterator< A, T > operator--(int)
detail::AccessorIterator< const CMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
ReverseAccessorIterator< A, T > operator++(int)
std::random_access_iterator_tag iterator_category
AccessorIterator< A, T > & operator+=(int off)
detail::AccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
value_type operator[](size_t i) const
const_reverse_iterator rbegin() const
const_reverse_iterator rend() const
A vector-like wrapper for a Matrix for accessing the elements of a given row with a [] operator...
const_reverse_iterator rend() const
#define ASSERT_(f)
Defines an assertion mechanism.
Definition: exceptions.h:120
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
int operator-(const ReverseAccessorIterator< A, T > &it) const
value_type operator[](size_t i) const
bool operator!=(const AccessorIterator< A, T > &it) const
detail::ReverseAccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
detail::AccessorIterator< const CConstMatrixRowAccessor< MAT >, const value_type > const_iterator
const_iterator begin() const
detail::ReverseAccessorIterator< CMatrixRowAccessor< MAT >, value_type > reverse_iterator
AccessorIterator< A, T > operator-(int off) const
bool operator!=(const ReverseAccessorIterator< A, T > &it) const
ReverseAccessorIterator< A, T > & operator+=(int off)
detail::ReverseAccessorIterator< const CMatrixRowAccessor< 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 Matrix for accessing the elements of a given row with a [] operator...
detail::AccessorIterator< CMatrixRowAccessor< MAT >, value_type > iterator
value_type operator[](size_t i) const
ReverseAccessorIterator< A, T > & operator++()
ReverseAccessorIterator< A, T > & operator--()
CConstMatrixRowAccessor(const MAT &mat, size_t row)
detail::ReverseAccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > reverse_iterator
CConstMatrixColumnAccessor(const MAT &mat, size_t colIdx)
detail::ReverseAccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
const_reverse_iterator rend() const
typename MAT::Scalar value_type
Template class for matrix accessor&#39;s iterators.
AccessorIterator< A, T > & operator++()
const_reverse_iterator rend() const
CMatrixColumnAccessor< MAT > getColumnAccessor(MAT &m, size_t colIdx)
detail::AccessorIterator< const CMatrixRowAccessor< MAT >, const value_type > const_iterator
const_iterator end() const
AccessorIterator< A, T > operator-(int off) const
const_reverse_iterator rbegin() const
detail::ReverseAccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
value_type & operator[](const size_t i)
ReverseAccessorIterator< A, T > operator+(int off) const
CMatrixColumnAccessorExtended(MAT &mat, size_t col, size_t offset, size_t space)
AccessorIterator< A, T > operator+(int off) const
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_reverse_iterator
const_reverse_iterator rend() const
Template class for matrix accessor&#39;s iterators.
detail::AccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_iterator
AccessorIterator< A, T > operator--(int)
detail::AccessorIterator< const CMatrixColumnAccessorExtended< MAT >, const value_type > const_iterator
detail::AccessorIterator< const CConstMatrixColumnAccessor< MAT >, const value_type > const_iterator
const_reverse_iterator rend() 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...
This template class provides the basic functionality for a general 2D any-size, resizable container o...
AccessorIterator< A, T > & operator-=(int off)
detail::AccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > iterator
detail::AccessorIterator< const CMatrixColumnAccessor< MAT >, const value_type > const_iterator
bool operator==(const ReverseAccessorIterator< A, T > &it) const
value_type operator[](const size_t i) const
CMatrixRowAccessor(MAT &mat, size_t rowIdx)
std::random_access_iterator_tag iterator_category
A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] opera...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020