Main MRPT website > C++ reference
MRPT logo
CArray.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-2014, 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_CArray_H
10 #define _MRPT_CArray_H
11 
12 #include <mrpt/utils/utils_defs.h>
13 #include <mrpt/math/math_frwds.h>
15 #include <mrpt/utils/CSerializable.h> // Used only for the extension to TTypeName
16 
17 namespace mrpt
18 {
19 namespace math
20 {
21  // ---------------- CArray -------------------------
22  /** A STL container (as wrapper) for arrays of constant size defined at compile time - <b>Users will most likely prefer to use CArrayPOD and its derived classes instead</b>.
23  *
24  * This code is an adapted version from Boost, modifed for its integration
25  * within MRPT (JLBC, Dec/2009) (Renamed array -> CArray to avoid possible potential conflicts).
26  *
27  * See
28  * http://www.josuttis.com/cppcode
29  * for details and the latest version.
30  * See
31  * http://www.boost.org/libs/array for Documentation.
32  * for documentation.
33  *
34  * (C) Copyright Nicolai M. Josuttis 2001.
35  * Permission to copy, use, modify, sell and distribute this software
36  * is granted provided this copyright notice appears in all copies.
37  * This software is provided "as is" without express or implied
38  * warranty, and with no claim as to its suitability for any purpose.
39  *
40  * 29 Jan 2004 - minor fixes (Nico Josuttis)
41  * 04 Dec 2003 - update to synch with library TR1 (Alisdair Meredith)
42  * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
43  * 05 Aug 2001 - minor update (Nico Josuttis)
44  * 20 Jan 2001 - STLport fix (Beman Dawes)
45  * 29 Sep 2000 - Initial Revision (Nico Josuttis)
46  *
47  * Jan 30, 2004
48  *
49  * \note This class DOES NOT support mathematical operations on its elements: it's a generic container, it doesn't assume they are numerical.
50  * \note For a summary and classification of all MRPT vector, array and matrix classes see: http://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes
51  *
52  * \sa CArrayNumeric (for another, non-related base template class that DOES support maths)
53  * \ingroup mrpt_base_grp
54  */
55  template <typename T, std::size_t N>
56  class CArray {
57  public:
58  T elems[N]; // fixed-size array of elements of type T
59 
60  public:
61  // type definitions
62  typedef T value_type;
63  typedef T* iterator;
64  typedef const T* const_iterator;
65  typedef T& reference;
66  typedef const T& const_reference;
67  typedef std::size_t size_type;
68  typedef std::ptrdiff_t difference_type;
69 
70  // iterator support
71  inline iterator begin() { return elems; }
72  inline const_iterator begin() const { return elems; }
73  inline iterator end() { return elems+N; }
74  inline const_iterator end() const { return elems+N; }
75 
76  // reverse iterator support
77 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
78  typedef std::reverse_iterator<iterator> reverse_iterator;
79  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
80 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
81  // workaround for broken reverse_iterator in VC7
82  typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
84  typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
86 #else
87  // workaround for broken reverse_iterator implementations
88  typedef std::reverse_iterator<iterator,T> reverse_iterator;
89  typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
90 #endif
91 
94  return const_reverse_iterator(end());
95  }
98  return const_reverse_iterator(begin());
99  }
100 
101  // operator[]
102  inline reference operator[](size_type i) { return elems[i]; }
103  inline const_reference operator[](size_type i) const { return elems[i]; }
104 
105  // at() with range check
106  reference at(size_type i) { rangecheck(i); return elems[i]; }
107  const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
108 
109  // front() and back()
110  reference front() { return elems[0]; }
111  const_reference front() const { return elems[0]; }
112  reference back() { return elems[N-1]; }
113  const_reference back() const { return elems[N-1]; }
114 
115  // size is constant
116  static inline size_type size() { return N; }
117  static bool empty() { return false; }
118  static size_type max_size() { return N; }
119  enum { static_size = N };
120 
121  /** This method has no effects in this class, but raises an exception if the expected size does not match */
122  inline void resize(const size_t nElements) {
123  if (nElements!=N)
124  throw std::logic_error(format("Try to change the size of a %u-CArray to %u.",static_cast<unsigned>(N),static_cast<unsigned>(nElements)));
125  }
126 
127  // swap (note: linear complexity in N, constant for given instantiation)
128  void swap (CArray<T,N>& y) {
129  std::swap_ranges(begin(),end(),y.begin());
130  }
131 
132  // direct access to data (read-only)
133  const T* data() const { return elems; }
134 
135  // use array as C array (direct read/write access to data)
136  T* data() { return elems; }
137 
138  // assignment with type conversion
139  template <typename T2>
141  std::copy(rhs.begin(),rhs.end(), begin());
142  return *this;
143  }
144 
145  // assign one value to all elements
146  inline void assign (const T& value)
147  {
148  for (size_t i=0;i<N;i++) elems[i]=value;
149  }
150  // assign (compatible with std::vector's one) (by JLBC for MRPT)
151  void assign (const size_t n, const T& value)
152  {
153  ASSERTDEB_(N==n);
154  for (size_t i=0;i<N;i++) elems[i]=value;
155  }
156 
157  //assign a range of values corresponding to a pair of iterators (by PMO for MRPT)
158  template<typename I> void assign(I b,const I &e) {
159  ASSERTDEB_(std::distance(b,e)==N);
160  for (iterator i=begin();i<end();++i) *i=*(b++);
161  }
162 
163  private:
164  // check range (may be private because it is static)
165  static void rangecheck (size_type i) {
166  if (i >= size()) {
167  throw std::out_of_range("CArray<>: index out of range");
168  }
169  }
170 
171  };
172 
173 // partial specialization for arrays of size 0
174  template <typename T>
175  class CArray<T,0> {
176  public:
177  char c; // to ensure different array intances return unique values for begin/end
178 
179  public:
180  // type definitions
181  typedef T value_type;
182  typedef T* iterator;
183  typedef const T* const_iterator;
184  typedef T& reference;
185  typedef const T& const_reference;
186  typedef std::size_t size_type;
187  typedef std::ptrdiff_t difference_type;
188 
189  // iterator support
190  iterator begin() { return reinterpret_cast< iterator >( &c ); }
191  const_iterator begin() const { return reinterpret_cast< const_iterator >( &c ); }
192  iterator end() { return reinterpret_cast< iterator >( &c ); }
193  const_iterator end() const { return reinterpret_cast< const_iterator >( &c ); }
194 
195  // reverse iterator support
196 #if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
197  typedef std::reverse_iterator<iterator> reverse_iterator;
198  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
199 #elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
200  // workaround for broken reverse_iterator in VC7
201  typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
203  typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
205 #else
206  // workaround for broken reverse_iterator implementations
207  typedef std::reverse_iterator<iterator,T> reverse_iterator;
208  typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
209 #endif
210 
213  return const_reverse_iterator(end());
214  }
217  return const_reverse_iterator(begin());
218  }
219 
220  // at() with range check
222  throw std::out_of_range("CArray<0>: index out of range");
223  }
225  throw std::out_of_range("<0>: index out of range");
226  }
227 
228  // size is constant
229  static size_type size() { return 0; }
230  static bool empty() { return true; }
231  static size_type max_size() { return 0; }
232  enum { static_size = 0 };
233 
234  // swap
235  void swap (CArray<T,0>& y) {
236  // could swap value of c, but value is not part of documented array state
237  }
238 
239  // direct access to data
240  const T* data() const { return NULL; }
241  T* data() { return NULL; }
242 
243  // assignment with type conversion
244  template < typename T2 >
246  return *this;
247  }
248 
249  // Calling these operations are undefined behaviour for 0-size arrays,
250  // but Library TR1 requires their presence.
251  // operator[]
252  inline reference operator[](size_type i) { makes_no_sense(); static T dumm=0; return dumm; }
253  inline const_reference operator[](size_type i) const { makes_no_sense(); static T dumm=0; return dumm; }
254 
255  // front() and back()
256  reference front() { makes_no_sense(); }
257  const_reference front() const { makes_no_sense(); }
258  reference back() { makes_no_sense(); }
259  const_reference back() const { makes_no_sense(); }
260 
261  private:
262  // helper for operations that have undefined behaviour for 0-size arrays,
263  // assert( false ); added to make lack of support clear
264  static void makes_no_sense () {
265  //assert(true);
266  throw std::out_of_range("CArray<0>: index out of range");
267  }
268  };
269 
270  // comparisons
271  template<class T, std::size_t N>
272  bool operator== (const CArray<T,N>& x, const CArray<T,N>& y) {
273  return std::equal(x.begin(), x.end(), y.begin());
274  }
275  template<class T, std::size_t N>
276  bool operator< (const CArray<T,N>& x, const CArray<T,N>& y) {
277  return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
278  }
279  template<class T, std::size_t N>
280  bool operator!= (const CArray<T,N>& x, const CArray<T,N>& y) {
281  return !(x==y);
282  }
283  template<class T, std::size_t N>
284  bool operator> (const CArray<T,N>& x, const CArray<T,N>& y) {
285  return y<x;
286  }
287  template<class T, std::size_t N>
288  bool operator<= (const CArray<T,N>& x, const CArray<T,N>& y) {
289  return !(y<x);
290  }
291  template<class T, std::size_t N>
292  bool operator>= (const CArray<T,N>& x, const CArray<T,N>& y) {
293  return !(x<y);
294  }
295 
296 
297 
298 
299  // ---------------- CArrayNumeric -------------------------
300 
301  /** CArrayNumeric is an array for numeric types supporting several mathematical operations (actually, just a wrapper on Eigen::Matrix<T,N,1>)
302  * \sa CArrayFloat, CArrayDouble, CArray
303  */
304  template <typename T, std::size_t N>
305  class CArrayNumeric : public Eigen::Matrix<T,N,1>
306  {
307  public:
308  typedef T value_type;
309  typedef Eigen::Matrix<T,N,1> Base;
310 
311  CArrayNumeric() {} //!< Default constructor
312  /** Constructor from initial values ptr[0]-ptr[N-1] */
313  CArrayNumeric(const T*ptr) : Eigen::Matrix<T,N,1>(ptr) {}
314 
316 
317  /** Initialization from a vector-like source, that is, anything implementing operator[]. */
318  template <class ARRAYLIKE>
319  explicit CArrayNumeric(const ARRAYLIKE &obj) : Eigen::Matrix<T,N,1>(obj) {}
320 
321  template<typename OtherDerived>
322  inline CArrayNumeric<T,N> & operator= (const Eigen::MatrixBase <OtherDerived>& other) {
323  Base::operator=(other);
324  return *this;
325  }
326 
327  };
328 
329  // -------------- Partial specializations of CArrayNumeric -----------
330 
331  /** A partial specialization of CArrayNumeric for float numbers.
332  * \sa CArrayNumeric, CArray */
333  template <std::size_t N>
334  class CArrayFloat : public CArrayNumeric<float,N>
335  {
336  public:
339 
340  CArrayFloat() {} //!< Default constructor
341  CArrayFloat(const float*ptr) : CArrayNumeric<float,N>(ptr) {} //!< Constructor from initial values ptr[0]-ptr[N-1]
342 
344 
345  /** Initialization from a vector-like source, that is, anything implementing operator[]. */
346  template <class ARRAYLIKE>
347  explicit CArrayFloat(const ARRAYLIKE &obj) : CArrayNumeric<float,N>(obj) {}
348  MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CArrayFloat) // Implements ctor and "operator =" for any other Eigen class
349  };
350 
351  /** A partial specialization of CArrayNumeric for double numbers.
352  * \sa CArrayNumeric, CArray */
353  template <std::size_t N>
354  class CArrayDouble : public CArrayNumeric<double,N>
355  {
356  public:
359 
360  CArrayDouble() {} //!< Default constructor
361  CArrayDouble(const double*ptr) : CArrayNumeric<double,N>(ptr) {} //!< Constructor from initial values ptr[0]-ptr[N-1]
362 
364 
365  /** Initialization from a vector-like source, that is, anything implementing operator[]. */
366  template <class ARRAYLIKE>
367  explicit CArrayDouble(const ARRAYLIKE &obj) : CArrayNumeric<double,N>(obj) {}
368  MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CArrayDouble) // Implements ctor and "operator =" for any other Eigen class
369  };
370 
371  /** A partial specialization of CArrayNumeric for int numbers.
372  * \sa CArrayNumeric, CArray */
373  template <std::size_t N>
374  class CArrayInt : public CArrayNumeric<int,N>
375  {
376  public:
379 
380  CArrayInt() {} //!< Default constructor
381  CArrayInt(const int*ptr) : CArrayNumeric<int,N>(ptr) {} //!< Constructor from initial values ptr[0]-ptr[N-1]
382  MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CArrayInt) // Implements ctor and "operator =" for any other Eigen class
383  };
384 
385  /** A partial specialization of CArrayNumeric for unsigned int numbers.
386  * \sa CArrayNumeric, CArray */
387  template <std::size_t N>
388  class CArrayUInt : public CArrayNumeric<unsigned int,N>
389  {
390  public:
393 
394  CArrayUInt() {} //!< Default constructor
395  CArrayUInt(const unsigned int*ptr) : CArrayNumeric<unsigned int,N>(ptr) {} //!< Constructor from initial values ptr[0]-ptr[N-1]
396  MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CArrayUInt) // Implements ctor and "operator =" for any other Eigen class
397  };
398 
399  /** Auxiliary class used in CMatrixTemplate:size(), CMatrixTemplate::resize(), CMatrixFixedNumeric::size(), CMatrixFixedNumeric::resize(), to mimic the behavior of STL-containers */
400  struct CMatrixTemplateSize : public Eigen::Matrix<size_t,2,1>
401  {
402  typedef Eigen::Matrix<size_t,2,1> Base;
404 
405  inline CMatrixTemplateSize() : Eigen::Matrix<size_t,2,1>() {}
406  inline CMatrixTemplateSize(const size_t *d) : Eigen::Matrix<size_t,2,1>(d) {}
407 
408  inline bool operator==(const CMatrixTemplateSize&o) const { return Eigen::Matrix<size_t,2,1>::operator()(0)==o[0] && Eigen::Matrix<size_t,2,1>::operator()(1)==o[1]; }
409  inline bool operator!=(const CMatrixTemplateSize&o) const { return !(*this==o); }
410  /** This operator allows the size(N,M) to be compared with a plain size_t N*M */
411  inline operator size_t(void) const { return Eigen::Matrix<size_t,2,1>::operator()(0)*Eigen::Matrix<size_t,2,1>::operator()(1); }
412  MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(CMatrixTemplateSize) // Implements ctor and "operator =" for any other Eigen class
413  };
414 
415 } // End of namespace
416 
417  namespace utils
418  {
419  // Extensions to mrpt::utils::TTypeName for matrices:
420  template<typename T,size_t N> struct TTypeName <mrpt::math::CArrayNumeric<T,N> > {
421  static std::string get() { return mrpt::format("CArrayNumeric<%s,%u>",TTypeName<T>::get().c_str(),static_cast<unsigned int>(N)); } };
422  template<size_t N> struct TTypeName <mrpt::math::CArrayDouble<N> > {
423  static std::string get() { return mrpt::format("CArrayNumeric<double,%u>",static_cast<unsigned int>(N)); } };
424  template<size_t N> struct TTypeName <mrpt::math::CArrayFloat<N> > {
425  static std::string get() { return mrpt::format("CArrayNumeric<float,%u>",static_cast<unsigned int>(N)); } };
426  }
427 
428 
429 } // End of namespace
430 
431 
432 #endif
bool operator!=(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:280
const_reference back() const
Definition: CArray.h:259
CArrayDouble(const double *ptr)
Constructor from initial values ptr[0]-ptr[N-1].
Definition: CArray.h:361
const_reference operator[](size_type i) const
Definition: CArray.h:103
const_reference at(size_type i) const
Definition: CArray.h:224
static bool empty()
Definition: CArray.h:230
reference back()
Definition: CArray.h:112
CArrayNumeric()
Default constructor.
Definition: CArray.h:311
static size_type size()
Definition: CArray.h:229
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: CArray.h:198
static bool empty()
Definition: CArray.h:117
CArrayInt< N > mrpt_autotype
Definition: CArray.h:378
A template to obtain the type of its argument as a string at compile time.
Definition: TTypeName.h:46
std::ptrdiff_t difference_type
Definition: CArray.h:187
std::reverse_iterator< iterator > reverse_iterator
Definition: CArray.h:197
const T * const_iterator
Definition: CArray.h:64
std::reverse_iterator< iterator > reverse_iterator
Definition: CArray.h:78
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Auxiliary class used in CMatrixTemplate:size(), CMatrixTemplate::resize(), CMatrixFixedNumeric::size(...
Definition: CArray.h:400
This file implements several operations that operate element-wise on individual or pairs of container...
bool operator!=(const CMatrixTemplateSize &o) const
Definition: CArray.h:409
static void makes_no_sense()
Definition: CArray.h:264
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually...
Definition: CArray.h:305
bool operator>(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:284
A partial specialization of CArrayNumeric for unsigned int numbers.
Definition: CArray.h:388
CArrayNumeric(const ARRAYLIKE &obj)
Initialization from a vector-like source, that is, anything implementing operator[].
Definition: CArray.h:319
std::size_t size_type
Definition: CArray.h:186
CArrayInt(const int *ptr)
Constructor from initial values ptr[0]-ptr[N-1].
Definition: CArray.h:381
CArrayFloat()
Default constructor.
Definition: CArray.h:340
void swap(CArray< T, N > &y)
Definition: CArray.h:128
bool operator>=(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:292
const T * data() const
Definition: CArray.h:240
void swap(CArray< T, 0 > &y)
Definition: CArray.h:235
#define MRPT_EIGEN_DERIVED_CLASS_CTOR_OPERATOR_EQUAL(_CLASS_)
const T & const_reference
Definition: CArray.h:66
void assign(const size_t n, const T &value)
Definition: CArray.h:151
reference at(size_type i)
Definition: CArray.h:106
const_iterator end() const
Definition: CArray.h:193
static size_type max_size()
Definition: CArray.h:231
reverse_iterator rend()
Definition: CArray.h:96
CArrayFloat(const ARRAYLIKE &obj)
Initialization from a vector-like source, that is, anything implementing operator[].
Definition: CArray.h:347
std::size_t size_type
Definition: CArray.h:67
A partial specialization of CArrayNumeric for int numbers.
Definition: CArray.h:374
reverse_iterator rbegin()
Definition: CArray.h:92
reference at(size_type i)
Definition: CArray.h:221
Eigen::Matrix< size_t, 2, 1 > Base
Definition: CArray.h:402
reference operator[](size_type i)
Definition: CArray.h:252
const_reference front() const
Definition: CArray.h:111
CArrayFloat(const float *ptr)
Constructor from initial values ptr[0]-ptr[N-1].
Definition: CArray.h:341
std::ptrdiff_t difference_type
Definition: CArray.h:68
bool operator==(const CArray< T, N > &x, const CArray< T, N > &y)
Definition: CArray.h:272
A partial specialization of CArrayNumeric for float numbers.
Definition: CArray.h:334
#define MRPT_MATRIX_CONSTRUCTORS_FROM_POSES(_CLASS_)
const_reference operator[](size_type i) const
Definition: CArray.h:253
const_reference at(size_type i) const
Definition: CArray.h:107
static size_type max_size()
Definition: CArray.h:118
const T * data() const
Definition: CArray.h:133
void assign(I b, const I &e)
Definition: CArray.h:158
CArrayUInt< N > mrpt_autotype
Definition: CArray.h:392
const_reference back() const
Definition: CArray.h:113
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
CArrayNumeric< T, N > & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CArray.h:322
CMatrixTemplateSize mrpt_autotype
Definition: CArray.h:403
const_reference front() const
Definition: CArray.h:257
CArrayNumeric< unsigned int, N > Base
Definition: CArray.h:391
CArrayNumeric< double, N > Base
Definition: CArray.h:357
const_iterator end() const
Definition: CArray.h:74
CArrayDouble()
Default constructor.
Definition: CArray.h:360
CArrayDouble< N > mrpt_autotype
Definition: CArray.h:358
void assign(const T &value)
Definition: CArray.h:146
const_iterator begin() const
Definition: CArray.h:191
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: CArray.h:79
reverse_iterator rend()
Definition: CArray.h:215
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define ASSERTDEB_(f)
Defines an assertion mechanism - only when compiled in debug.
CArrayDouble(const ARRAYLIKE &obj)
Initialization from a vector-like source, that is, anything implementing operator[].
Definition: CArray.h:367
CArray< T, N > & operator=(const CArray< T2, N > &rhs)
Definition: CArray.h:140
iterator begin()
Definition: CArray.h:71
A STL container (as wrapper) for arrays of constant size defined at compile time - Users will most li...
Definition: CArray.h:56
reference front()
Definition: CArray.h:110
const_reverse_iterator rend() const
Definition: CArray.h:97
CArrayUInt()
Default constructor.
Definition: CArray.h:394
CArrayNumeric(const T *ptr)
Constructor from initial values ptr[0]-ptr[N-1].
Definition: CArray.h:313
iterator end()
Definition: CArray.h:73
A partial specialization of CArrayNumeric for double numbers.
Definition: CArray.h:354
reference operator[](size_type i)
Definition: CArray.h:102
CArrayNumeric< float, N > Base
Definition: CArray.h:337
void resize(const size_t nElements)
This method has no effects in this class, but raises an exception if the expected size does not match...
Definition: CArray.h:122
const_reverse_iterator rend() const
Definition: CArray.h:216
const_reverse_iterator rbegin() const
Definition: CArray.h:212
reverse_iterator rbegin()
Definition: CArray.h:211
Eigen::Matrix< T, N, 1 > Base
Definition: CArray.h:309
const_iterator begin() const
Definition: CArray.h:72
bool operator==(const CMatrixTemplateSize &o) const
Definition: CArray.h:408
static size_type size()
Definition: CArray.h:116
CArrayInt()
Default constructor.
Definition: CArray.h:380
static void rangecheck(size_type i)
Definition: CArray.h:165
const T * const_iterator
Definition: CArray.h:183
CMatrixTemplateSize(const size_t *d)
Definition: CArray.h:406
const_reverse_iterator rbegin() const
Definition: CArray.h:93
const T & const_reference
Definition: CArray.h:185
CArrayNumeric< int, N > Base
Definition: CArray.h:377
CArrayUInt(const unsigned int *ptr)
Constructor from initial values ptr[0]-ptr[N-1].
Definition: CArray.h:395
double BASE_IMPEXP distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
CArrayFloat< N > mrpt_autotype
Definition: CArray.h:338



Page generated by Doxygen 1.8.14 for MRPT 1.1.0 SVN: at lun oct 28 00:54:49 CET 2019 Hosted on:
SourceForge.net Logo