Main MRPT website > C++ reference for MRPT 1.5.6
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:
33  DEFINE_SERIALIZABLE_CUSTOM_LINKAGE( CMatrixD, void BASE_IMPEXP, static BASE_IMPEXP, virtual BASE_IMPEXP )
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
GLenum GLenum GLvoid * row
Definition: glew.h:2903
This class is a "CSerializable" wrapper for "CMatrixTemplateNumeric<double>".
Definition: CMatrixD.h:30
#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:184
#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:189
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
#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...
CMatrixD(const CMatrixFloat &m)
Copy constructor.
Definition: CMatrixD.h:48
CMatrixD(size_t row, size_t col)
Constructor.
Definition: CMatrixD.h:40
GLuint in
Definition: glew.h:7146
GLfloat GLfloat p
Definition: glew.h:10113
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Lightweight 2D pose.
const GLdouble * m
Definition: glew.h:5094
CMatrixD(const CMatrixTemplateNumeric< double > &m)
Copy constructor.
Definition: CMatrixD.h:44
Lightweight 3D point.
CMatrixD(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CMatrixD.h:60
Lightweight 2D point.



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018