Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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
15namespace 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...
22 DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(CMatrixD, mrpt::utils::CSerializable, CMatrixD)
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:184
#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:179
#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 TPoint3D &p)
Constructor from a TPoint3D, which generates a 3x1 matrix .
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(const TPoint2D &p)
Constructor from a TPoint2D, which generates a 2x1 matrix .
CMatrixD(size_t row, size_t col)
Constructor.
Definition: CMatrixD.h:40
CMatrixD(const TPose2D &p)
Constructor from a TPose2D, which generates a 3x1 matrix
CMatrixD(const TPose3D &p)
Constructor from a TPose3D, which generates a 6x1 matrix
CMatrixD(const CMatrixTemplateNumeric< double > &m)
Copy constructor.
Definition: CMatrixD.h:44
CMatrixTemplateNumeric< T > & operator=(const CMatrixTemplate< R > &m)
Assignment operator of other types.
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.6 for MRPT 1.4.0 SVN: at Fri Jan 20 00:13:14 UTC 2023