Main MRPT website > C++ reference for MRPT 1.9.9
matrix_adaptors.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef mrpt_matrix_adaptors_H
10 #define mrpt_matrix_adaptors_H
11 
12 #include <mrpt/utils/utils_defs.h>
13 #include <mrpt/math/math_frwds.h> // forward declarations
14 
15 namespace mrpt
16 {
17 namespace math
18 {
19 /** Internal classes not to be directly used by the user. */
20 // Forward declarations:
21 template <typename T, typename U, bool UIsObject>
22 class CBinaryRelation;
23 namespace detail
24 {
25 /**
26  * This template is a trick to switch the type of a variable using a boolean
27  * variable in the template. It's easy to extend its functionality to several
28  * types, using a unsigned char instead of a bool.
29  */
30 template <typename U, bool B>
32 
33 // partial specializations:
34 template <typename U>
35 class MatrixWrapper<U, true>
36 {
37  public:
39 };
40 template <typename U>
41 class MatrixWrapper<U, false>
42 {
43  public:
45 };
46 
47 template <typename T, typename U, bool UIsObject, typename FunctionType>
48 inline void applyFunction(
49  CBinaryRelation<T, U, UIsObject>& o, FunctionType fun, size_t e1, size_t e2,
50  const T& T1, const T& T2);
51 }
52 
53 namespace detail
54 {
55 /** Template class for matrix accessor's iterators.
56  * \sa CMatrixRowAccessor,CMatrixColumnAccessor
57  */
58 template <typename A, typename T>
60 {
61  protected:
62  A* base;
63  int pos;
64 
65  public:
66  // typedefs for iterator_traits:
67  typedef std::random_access_iterator_tag iterator_category;
68  typedef T value_type;
69  typedef int difference_type;
70  typedef T* pointer;
71  typedef T& reference;
72 
73  inline AccessorIterator(A& obj, size_t N) : base(&obj), pos(N) {}
74  inline T& operator*() const { return (*base)[pos]; }
76  {
77  ++pos;
78  return *this;
79  }
81  {
82  AccessorIterator<A, T> it = *this;
83  ++*this;
84  return it;
85  }
87  {
88  --pos;
89  return *this;
90  }
92  {
93  AccessorIterator<A, T> it = *this;
94  --*this;
95  return it;
96  }
98  {
99  pos += off;
100  return *this;
101  }
102  inline AccessorIterator<A, T> operator+(int off) const
103  {
104  AccessorIterator<A, T> it = *this;
105  it += off;
106  return it;
107  }
109  {
110  pos -= off;
111  return *this;
112  }
113  inline AccessorIterator<A, T> operator-(int off) const
114  {
115  AccessorIterator<A, T> it = *this;
116  it -= off;
117  return it;
118  }
119  inline int operator-(const AccessorIterator<A, T>& it) const
120  {
121  return pos - it.pos;
122  }
123  inline T& operator[](int off) const { return (*base)[pos + off]; }
124  inline bool operator==(const AccessorIterator<A, T>& it) const
125  {
126  return (pos == it.pos) && (base == it.base);
127  }
128  inline bool operator!=(const AccessorIterator<A, T>& it) const
129  {
130  return !(operator==(it));
131  }
132 };
133 
134 /** Template class for matrix accessor's iterators.
135  * \sa CMatrixRowAccessor,CMatrixColumnAccessor
136  */
137 template <typename A, typename T>
139 {
140  protected:
141  A* base;
142  int pos;
143 
144  public:
145  // typedefs for iterator_traits:
146  typedef std::random_access_iterator_tag iterator_category;
147  typedef T value_type;
148  typedef int difference_type;
149  typedef T* pointer;
150  typedef T& reference;
151 
152  inline ReverseAccessorIterator(A& obj, size_t N) : base(&obj), pos(N) {}
153  inline T& operator*() const { return (*base)[pos]; }
155  {
156  --pos;
157  return *this;
158  }
160  {
162  ++*this; // Yes, that's right.
163  return it;
164  }
166  {
167  ++pos;
168  return *this;
169  }
171  {
173  --*this; // Yes, that's right.
174  return it;
175  }
177  {
178  pos -= off;
179  return *this;
180  }
182  {
184  it += off; // Yes, that's right.
185  return it;
186  }
188  {
189  pos += off;
190  return *this;
191  }
192  inline AccessorIterator<A, T> operator-(int off) const
193  {
195  it -= off; // Yes, that's right
196  return it;
197  }
198  inline int operator-(const ReverseAccessorIterator<A, T>& it) const
199  {
200  return it.pos - pos;
201  }
202  inline T& operator[](int off) const { return (*base)[pos - off]; }
203  inline bool operator==(const ReverseAccessorIterator<A, T>& it) const
204  {
205  return (pos == it.pos) && (&base == &it.base);
206  }
207  inline bool operator!=(const ReverseAccessorIterator<A, T>& it) const
208  {
209  return !(operator==(it));
210  }
211 };
212 } // End of detail namespace
213 
214 /** A vector-like wrapper for a Matrix for accessing the elements of a given row
215  * with a [] operator.
216  * For usage with MRPT's CMatrixTemplate only (for MRPT numeric matrices, use
217  * Eigen methods)
218  * \sa
219  * CMatrixColumnAccessor,CMatrixRowAccessorExtended,CConstMatrixRowAccessor,CConstMatrixRowAccessorExtended
220  */
221 template <typename MAT>
223 {
224  protected:
225  MAT* m_mat;
226  size_t m_rowInd;
227 
228  public:
229  typedef typename MAT::Scalar value_type;
231  inline CMatrixRowAccessor(MAT& mat, size_t rowIdx)
232  : m_mat(&mat), m_rowInd(rowIdx)
233  {
234  ASSERT_(rowIdx < mat.getRowCount())
235  }
236  inline CMatrixRowAccessor() {}
237  inline value_type& operator[](const size_t i)
238  {
239  return (*m_mat)(m_rowInd, i);
240  }
241  inline value_type operator[](const size_t i) const
242  {
243  return (*m_mat)(m_rowInd, i);
244  }
248  const value_type>
253  const value_type>
255  inline iterator begin() { return iterator(*this, 0); }
256  inline const_iterator begin() const { return const_iterator(*this, 0); }
257  inline iterator end() { return iterator(*this, m_mat->getColCount()); }
258  inline const_iterator end() const
259  {
260  return const_iterator(*this, m_mat->getColCount());
261  }
263  {
264  return reverse_iterator(*this, m_mat->getColCount() - 1);
265  }
267  {
268  return const_reverse_iterator(*this, m_mat->getColCount() - 1);
269  }
270  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
272  {
273  return const_reverse_iterator(*this, -1);
274  }
275  inline size_t size() const { return m_mat->getColCount(); }
276  inline void resize(size_t N)
277  {
278  if (N != size())
279  throw std::logic_error("Tried to resize a fixed-size vector");
280  }
281 };
282 template <typename MAT>
283 inline CMatrixRowAccessor<MAT> getRowAccessor(MAT& m, size_t rowIdx)
284 {
285  return CMatrixRowAccessor<MAT>(m, rowIdx);
286 }
287 
288 /** A vector-like wrapper for a Matrix for accessing the elements of a given row
289  * with a [] operator, with offset and custom spacing.
290  * For usage with MRPT's CMatrixTemplate only (for MRPT numeric matrices, use
291  * Eigen methods)
292  * \sa
293  * CMatrixColumnAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessor,CConstMatrixRowAccessorExtended
294  */
295 template <class MAT>
297 {
298  protected:
299  MAT* m_mat;
300  size_t m_rowInd;
301  size_t m_colOffset;
303  size_t howMany;
304 
305  public:
306  typedef typename MAT::Scalar value_type;
309  MAT& mat, size_t row, size_t offset, size_t space)
310  : m_mat(&mat),
311  m_rowInd(row),
313  m_elementsSpace(space)
314  {
315  ASSERT_(row < mat.getRowCount());
316  howMany = (mat.getColCount() - m_colOffset) / m_elementsSpace;
317  }
319  inline value_type& operator[](size_t i)
320  {
321  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
322  }
323  inline value_type operator[](size_t i) const
324  {
325  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
326  }
328  value_type>
331  const value_type>
334  value_type>
339  inline iterator begin() { return iterator(*this, 0); }
340  inline const_iterator begin() const { return const_iterator(*this, 0); }
341  inline iterator end() { return iterator(*this, howMany); }
342  inline const_iterator end() const { return const_iterator(*this, howMany); }
344  {
345  return reverse_iterator(*this, howMany - 1);
346  }
348  {
349  return const_reverse_iterator(*this, howMany - 1);
350  }
351  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
353  {
354  return const_reverse_iterator(*this, -1);
355  }
356  inline size_t size() const { return howMany; }
357  inline void resize(size_t N)
358  {
359  if (N != size())
360  throw std::logic_error("Tried to resize a fixed-size vector");
361  }
362 };
363 template <typename MAT>
365  MAT& m, size_t rowIdx, size_t offset, size_t space = 1)
366 {
367  return CMatrixRowAccessor<MAT>(m, rowIdx, offset, space);
368 }
369 
370 /** A vector-like wrapper for a const Matrix for accessing the elements of a
371  * given row with a [] operator.
372  * For usage with MRPT's CMatrixTemplate only (for MRPT numeric matrices, use
373  * Eigen methods)
374  * \sa
375  * CConstMatrixColumnAccessor,CMatrixRowAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessorExtended
376  */
377 template <class MAT>
379 {
380  protected:
381  const MAT* m_mat;
382  size_t m_rowInd;
383 
384  public:
385  typedef typename MAT::Scalar value_type;
387  inline CConstMatrixRowAccessor(const MAT& mat, size_t row)
388  : m_mat(&mat), m_rowInd(row)
389  {
390  ASSERT_(row < mat.getRowCount());
391  }
393  inline value_type operator[](size_t i) const
394  {
395  return (*m_mat)(m_rowInd, i);
396  }
398  const value_type>
401  const value_type>
403  inline const_iterator begin() const { return const_iterator(*this, 0); }
404  inline const_iterator end() const
405  {
406  return const_iterator(*this, m_mat->getColCount());
407  }
409  {
410  return const_reverse_iterator(*this, m_mat->getColCount() - 1);
411  }
413  {
414  return const_reverse_iterator(*this, -1);
415  }
416  inline size_t size() const { return m_mat->getColCount(); }
417  inline void resize(size_t N)
418  {
419  if (N != size())
420  throw std::logic_error("Tried to resize a fixed-size vector");
421  }
422 };
423 template <typename MAT>
424 inline CConstMatrixRowAccessor<MAT> getRowAccessor(const MAT& m, size_t rowIdx)
425 {
426  return CMatrixRowAccessor<MAT>(m, rowIdx);
427 }
428 
429 /** A vector-like wrapper for a const Matrix for accessing the elements of a
430  * given row with a [] operator, with offset and custom spacing.
431  * For usage with MRPT's CMatrixTemplate only (for MRPT numeric matrices, use
432  * Eigen methods)
433  * \sa
434  * CConstMatrixColumnAccessorExtended,CMatrixRowAccessor,CConstMatrixRowAccessor,CMatrixRowAccessorExtended
435  */
436 template <class MAT>
438 {
439  protected:
440  const MAT* m_mat;
441  size_t m_rowInd;
442  size_t m_colOffset;
444  size_t howMany;
445 
446  public:
447  typedef typename MAT::Scalar value_type;
450  const MAT& mat, size_t row, size_t offset, size_t space)
451  : m_mat(&mat),
452  m_rowInd(row),
454  m_elementsSpace(space)
455  {
456  ASSERT_(row < mat.getRowCount());
457  howMany = (mat.getColCount() - m_colOffset) / m_elementsSpace;
458  }
460  inline value_type operator[](size_t i) const
461  {
462  return (*m_mat)(m_rowInd, m_colOffset + (i * m_elementsSpace));
463  }
465  const value_type>
470  inline const_iterator begin() const { return const_iterator(*this, 0); }
471  inline const_iterator end() const { return const_iterator(*this, howMany); }
473  {
474  return const_reverse_iterator(*this, howMany - 1);
475  }
477  {
478  return const_reverse_iterator(*this, -1);
479  }
480  inline size_t size() const { return howMany; }
481  inline void resize(size_t N)
482  {
483  if (N != size())
484  throw std::logic_error("Tried to resize a fixed-size vector");
485  }
486 };
487 template <typename MAT>
489  const MAT& m, size_t rowIdx, size_t offset, size_t space = 1)
490 {
491  return CConstMatrixRowAccessorExtended<MAT>(m, rowIdx, offset, space);
492 }
493 
494 /** A vector-like wrapper for a Matrix for accessing the elements of a given
495  * column with a [] operator.
496  * \sa
497  * CMatrixRowAccessor,CMatrixColumnAccessorExtended,CConstMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
498  */
499 template <typename MAT>
501 {
502  protected:
503  MAT* m_mat;
504  size_t m_colInd;
505 
506  public:
507  typedef typename MAT::Scalar value_type;
509  inline CMatrixColumnAccessor(MAT& mat, size_t colIdx)
510  : m_mat(&mat), m_colInd(colIdx)
511  {
512  ASSERT_(colIdx < mat.getColCount())
513  }
515  inline value_type& operator[](const size_t i)
516  {
517  return (*m_mat)(i, m_colInd);
518  }
519  inline value_type operator[](const size_t i) const
520  {
521  return (*m_mat)(i, m_colInd);
522  }
526  const value_type>
529  value_type>
532  const value_type>
534  inline iterator begin() { return iterator(*this, 0); }
535  inline const_iterator begin() const { return const_iterator(*this, 0); }
536  inline iterator end() { return iterator(*this, m_mat->getRowCount()); }
537  inline const_iterator end() const
538  {
539  return const_iterator(*this, m_mat->getRowCount());
540  }
542  {
543  return reverse_iterator(*this, m_mat->getRowCount() - 1);
544  }
546  {
547  return const_reverse_iterator(*this, m_mat->getRowCount() - 1);
548  }
549  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
551  {
552  return const_reverse_iterator(*this, -1);
553  }
554  inline size_t size() const { return m_mat->getRowCount(); }
555  inline void resize(size_t N)
556  {
557  if (N != size())
558  throw std::logic_error("Tried to resize a fixed-size vector");
559  }
560 };
561 template <typename MAT>
562 inline CMatrixColumnAccessor<MAT> getColumnAccessor(MAT& m, size_t colIdx)
563 {
564  return CMatrixColumnAccessor<MAT>(m, colIdx);
565 }
566 
567 /** A vector-like wrapper for a Matrix for accessing the elements of a given
568  * column with a [] operator, with offset and custom spacing.
569  * \sa
570  * CMatrixRowAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
571  */
572 template <typename MAT>
574 {
575  protected:
576  MAT* m_mat;
577  size_t m_colInd;
578  size_t m_rowOffset;
580  size_t howMany;
581 
582  public:
583  typedef typename MAT::Scalar value_type;
586  MAT& mat, size_t col, size_t offset, size_t space)
587  : m_mat(&mat),
588  m_colInd(col),
590  m_elementsSpace(space)
591  {
592  ASSERT_(col < mat.getColCount());
593  howMany = (mat.getRowCount() - m_rowOffset) / m_elementsSpace;
594  }
596  inline value_type& operator[](size_t i)
597  {
598  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
599  }
600  inline value_type operator[](size_t i) const
601  {
602  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
603  }
605  value_type>
608  const value_type>
611  value_type>
616  inline iterator begin() { return iterator(*this, 0); }
617  inline const_iterator begin() const { return const_iterator(*this, 0); }
618  inline iterator end() { return iterator(*this, howMany); }
619  inline const_iterator end() const { return const_iterator(*this, howMany); }
621  {
622  return reverse_iterator(*this, howMany - 1);
623  }
625  {
626  return const_reverse_iterator(*this, howMany - 1);
627  }
628  inline reverse_iterator rend() { return reverse_iterator(*this, -1); }
630  {
631  return const_reverse_iterator(*this, -1);
632  }
633  inline size_t size() const { return howMany; }
634  inline void resize(size_t N)
635  {
636  if (N != size())
637  throw std::logic_error("Tried to resize a fixed-size vector");
638  }
639 };
640 template <typename MAT>
642  MAT& m, size_t colIdx, size_t offset, size_t space = 1)
643 {
644  return CMatrixColumnAccessorExtended<MAT>(m, colIdx, offset, space);
645 }
646 
647 /** A vector-like wrapper for a const Matrix for accessing the elements of a
648  * given column with a [] operator.
649  * \sa
650  * CConstMatrixRowAccessor,CMatrixColumnAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessorExtended
651  */
652 template <class MAT>
654 {
655  protected:
656  const MAT* m_mat;
657  size_t m_colInd;
658 
659  public:
660  typedef typename MAT::Scalar value_type;
662  inline CConstMatrixColumnAccessor(const MAT& mat, size_t colIdx)
663  : m_mat(&mat), m_colInd(colIdx)
664  {
665  ASSERT_(colIdx < mat.getColCount());
666  }
668  inline value_type operator[](size_t i) const
669  {
670  return (*m_mat)(i, m_colInd);
671  }
673  const value_type>
678  inline const_iterator begin() const { return const_iterator(*this, 0); }
679  inline const_iterator end() const
680  {
681  return const_iterator(*this, m_mat->getRowCount());
682  }
684  {
685  return const_reverse_iterator(*this, m_mat->getRowCount() - 1);
686  }
688  {
689  return const_reverse_iterator(*this, -1);
690  }
691  inline size_t size() const { return m_mat->getRowCount(); }
692  inline void resize(size_t N)
693  {
694  if (N != size())
695  throw std::logic_error("Tried to resize a fixed-size vector");
696  }
697 };
698 template <typename MAT>
700  const MAT& m, size_t colIdx)
701 {
702  return CConstMatrixColumnAccessor<MAT>(m, colIdx);
703 }
704 
705 /** A vector-like wrapper for a const Matrix for accessing the elements of a
706  * given column with a [] operator, with offset and custom spacing.
707  * \sa
708  * CConstMatrixRowAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessor,CMatrixColumnAccessorExtended
709  */
710 template <typename MAT>
712 {
713  protected:
714  const MAT* m_mat;
715  size_t m_colInd;
716  size_t m_rowOffset;
718  size_t howMany;
719 
720  public:
721  typedef typename MAT::Scalar value_type;
724  const MAT& mat, size_t col, size_t offset, size_t space)
725  : m_mat(&mat),
726  m_colInd(col),
728  m_elementsSpace(space)
729  {
730  ASSERT_(col < mat.getColCount());
731  howMany = (mat.getRowCount() - m_rowOffset) / m_elementsSpace;
732  }
734  inline value_type operator[](size_t i) const
735  {
736  return (*m_mat)(m_rowOffset + (i * m_elementsSpace), m_colInd);
737  }
738  typedef detail::AccessorIterator<
744  inline const_iterator begin() const { return const_iterator(*this, 0); }
745  inline const_iterator end() const { return const_iterator(*this, howMany); }
747  {
748  return const_reverse_iterator(*this, howMany - 1);
749  }
751  {
752  return const_reverse_iterator(*this, -1);
753  }
754  inline size_t size() const { return howMany; }
755  inline void resize(size_t N)
756  {
757  if (N != size())
758  throw std::logic_error("Tried to resize a fixed-size vector");
759  }
760 };
761 template <typename MAT>
763  const MAT& m, size_t colIdx, size_t offset, size_t space = 1)
764 {
765  return CConstMatrixColumnAccessorExtended<MAT>(m, colIdx, offset, space);
766 }
767 
768 } // End of namespace
769 } // End of namespace
770 
771 #endif
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
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)
CMatrixRowAccessor< MAT > mrpt_autotype
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...
CConstMatrixRowAccessorExtended(const MAT &mat, size_t row, size_t offset, size_t space)
const_reverse_iterator rbegin() const
detail::ReverseAccessorIterator< CMatrixColumnAccessorExtended< MAT >, value_type > reverse_iterator
const_reverse_iterator rbegin() const
value_type operator[](const size_t i) const
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)
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...
GLintptr offset
Definition: glext.h:3925
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
detail::AccessorIterator< CMatrixRowAccessorExtended< MAT >, value_type > iterator
AccessorIterator< A, T > & operator+=(int off)
detail::ReverseAccessorIterator< const CConstMatrixRowAccessorExtended< MAT >, const value_type > const_reverse_iterator
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
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
detail::ReverseAccessorIterator< CMatrixColumnAccessor< MAT >, value_type > reverse_iterator
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
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)
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...
std::random_access_iterator_tag iterator_category
value_type operator[](size_t i) const
ReverseAccessorIterator< A, T > & operator++()
ReverseAccessorIterator< A, T > & operator--()
CConstMatrixRowAccessor(const MAT &mat, size_t row)
CConstMatrixColumnAccessor(const MAT &mat, size_t colIdx)
This template class provides the basic functionality for a general 2D any-size, resizable container o...
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
CConstMatrixRowAccessorExtended< MAT > mrpt_autotype
Template class for matrix accessor&#39;s iterators.
CMatrixColumnAccessorExtended< MAT > mrpt_autotype
AccessorIterator< A, T > & operator++()
const_reverse_iterator rend() const
GLenum GLenum GLvoid * row
Definition: glext.h:3576
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
const_reverse_iterator rbegin() const
#define ASSERT_(f)
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
CMatrixColumnAccessorExtended(MAT &mat, size_t col, size_t offset, size_t space)
AccessorIterator< A, T > operator+(int off) const
const_reverse_iterator rend() const
Template class for matrix accessor&#39;s iterators.
AccessorIterator< A, T > operator--(int)
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...
detail::ReverseAccessorIterator< const CConstMatrixColumnAccessorExtended< MAT >, const value_type > const_reverse_iterator
double Scalar
Definition: KmUtils.h:44
std::random_access_iterator_tag iterator_category
This template class extends the class "CMatrixTemplate" for storing "objects" at each matrix entry...
AccessorIterator< A, T > & operator-=(int off)
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
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...



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019