Main MRPT website > C++ reference for MRPT 1.4.0
CMatrix.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 CMATRIX_H
10#define CMATRIX_H
11
15
16namespace mrpt
17{
18 namespace math
19 {
20 // This must be added to any CSerializable derived class:
21 // Note: instead of the standard "DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE", classes inheriting
22 // from templates need special nasty handling for MSVC DLL exports...
24 BASE_IMPEXP ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, CMatrixPtr &pObj);
25
26 /** This class is a "CSerializable" wrapper for "CMatrixFloat".
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 CMatrix : public mrpt::utils::CSerializable, public CMatrixFloat
31 {
32 // This must be added to any CSerializable derived class:
34
35 public:
36 /** Constructor */
38 { }
39
40 /** Constructor */
41 CMatrix(size_t row, size_t col) : CMatrixFloat(row,col)
42 { }
43
44 /** Copy constructor
45 */
47 { }
48
49 /** Copy constructor
50 */
52 {
53 *this = m.eval().cast<float>();
54 }
55
56 /** Constructor from a TPose2D, which generates a 3x1 matrix \f$ [x y \phi]^T \f$ */
57 explicit CMatrix( const TPose2D &p);
58 /** Constructor from a mrpt::poses::CPose6D, which generates a 6x1 matrix \f$ [x y z yaw pitch roll]^T \f$ */
59 explicit CMatrix( const TPose3D &p);
60 /** Constructor from a TPoint2D, which generates a 2x1 matrix \f$ [x y]^T \f$ */
61 explicit CMatrix( const TPoint2D &p);
62 /** Constructor from a TPoint3D, which generates a 3x1 matrix \f$ [x y z]^T \f$ */
63 explicit CMatrix( const TPoint3D &p);
64
65 /** Assignment operator for float matrixes
66 */
67 template <class OTHERMAT>
68 inline CMatrix & operator = (const OTHERMAT& m)
69 {
70 CMatrixFloat::operator =(m);
71 return *this;
72 }
73
74 /*! Assignment operator from any other Eigen class */
75 template<typename OtherDerived>
76 inline CMatrix & operator= (const Eigen::MatrixBase <OtherDerived>& other) {
78 return *this;
79 }
80 /*! Constructor from any other Eigen class */
81 template<typename OtherDerived>
82 inline CMatrix(const Eigen::MatrixBase <OtherDerived>& other) : CMatrixTemplateNumeric<float>(other) { }
83
84 }; // end of class definition
86
87 } // End of namespace
88} // End of namespace
89
90#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 "CMatrixFloat".
Definition: CMatrix.h:31
CMatrix(size_t row, size_t col)
Constructor
Definition: CMatrix.h:41
CMatrix(const TPose2D &p)
Constructor from a TPose2D, which generates a 3x1 matrix .
CMatrix(const CMatrixTemplateNumeric< double > &m)
Copy constructor.
Definition: CMatrix.h:51
CMatrix(const CMatrixFloat &m)
Copy constructor.
Definition: CMatrix.h:46
CMatrix(const TPoint2D &p)
Constructor from a TPoint2D, which generates a 2x1 matrix
CMatrix()
Constructor
Definition: CMatrix.h:37
CMatrix(const TPoint3D &p)
Constructor from a TPoint3D, which generates a 3x1 matrix .
CMatrix(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CMatrix.h:82
CMatrix(const TPose3D &p)
Constructor from a mrpt::poses::CPose6D, which generates a 6x1 matrix
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:40
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.4 for MRPT 1.4.0 SVN: at Sun Aug 14 11:28:23 UTC 2022