Main MRPT website > C++ reference for MRPT 1.5.7
CMatrixD.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 CMATRIXD_H
10 #define CMATRIXD_H
11 
14 
15 namespace mrpt
16 {
17  namespace math
18  {
19  // This must be added to any CSerializable derived class:
20  // Note: instead of the standard "DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE", classes inheriting
21  // from templates need special nasty handling for MSVC DLL exports...
23  BASE_IMPEXP ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, CMatrixDPtr &pObj);
24 
25 
26  /** This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
27  * \note For a complete introduction to Matrices and vectors in MRPT, see: http://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes
28  * \ingroup mrpt_base_grp
29  */
30  class BASE_IMPEXP_TEMPL CMatrixD : public mrpt::utils::CSerializable, public CMatrixTemplateNumeric<double>
31  {
32  // This must be added to any CSerializable derived class:
34  public:
35  /** Constructor */
37  { }
38 
39  /** Constructor */
40  CMatrixD(size_t row, size_t col) : CMatrixTemplateNumeric<double>(row,col)
41  { }
42 
43  /** Copy constructor */
45  { }
46 
47  /** Copy constructor */
48  CMatrixD( const CMatrixFloat &m ) : CMatrixTemplateNumeric<double>(0,0) {
49  *this = m.eval().cast<double>();
50  }
51 
52  /*! Assignment operator from any other Eigen class */
53  template<typename OtherDerived>
54  inline CMatrixD & operator= (const Eigen::MatrixBase <OtherDerived>& other) {
56  return *this;
57  }
58  /*! Constructor from any other Eigen class */
59  template<typename OtherDerived>
60  inline CMatrixD(const Eigen::MatrixBase <OtherDerived>& other) : CMatrixTemplateNumeric<double>(other) { }
61 
62  /** Constructor from a TPose2D, which generates a 3x1 matrix \f$ [x y \phi]^T \f$ */
63  explicit CMatrixD( const TPose2D &p);
64  /** Constructor from a TPose3D, which generates a 6x1 matrix \f$ [x y z yaw pitch roll]^T \f$ */
65  explicit CMatrixD( const TPose3D &p);
66  /** Constructor from a TPoint2D, which generates a 2x1 matrix \f$ [x y]^T \f$ */
67  explicit CMatrixD( const TPoint2D &p);
68  /** Constructor from a TPoint3D, which generates a 3x1 matrix \f$ [x y z]^T \f$ */
69  explicit CMatrixD( const TPoint3D &p);
70 
71  }; // end of class definition
73 
74  } // End of namespace
75 } // End of namespace
76 
77 #endif
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
This declaration must be inserted in all CObject classes definition, after the class declaration.
Definition: CObject.h:204
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
This declaration must be inserted in all CObject classes definition, before the class declaration.
Definition: CObject.h:199
#define DEFINE_SERIALIZABLE_CUSTOM_LINKAGE(class_name, _VOID_LINKAGE_, _STATIC_LINKAGE_, _VIRTUAL_LINKAGE_)
Like DEFINE_SERIALIZABLE, but for template classes that need the DLL imp/exp keyword in Windows.
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
Definition: CMatrixD.h:31
CMatrixD(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CMatrixD.h:60
CMatrixD()
Constructor.
Definition: CMatrixD.h:36
CMatrixD(const CMatrixFloat &m)
Copy constructor
Definition: CMatrixD.h:48
CMatrixD(size_t row, size_t col)
Constructor.
Definition: CMatrixD.h:40
CMatrixD(const CMatrixTemplateNumeric< double > &m)
Copy constructor.
Definition: CMatrixD.h:44
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:40
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:39
GLenum GLenum GLvoid * row
Definition: glext.h:3533
GLuint in
Definition: glext.h:6301
GLfloat GLfloat p
Definition: glext.h:5587
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Lightweight 2D point.
Lightweight 3D point.
Lightweight 2D pose.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).



Page generated by Doxygen 1.9.1 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at mar 26 may 2026 13:12:03 CEST