Main MRPT website > C++ reference for MRPT 1.9.9
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-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 CMATRIX_H
10 #define CMATRIX_H
11 
15 
16 namespace mrpt
17 {
18 namespace math
19 {
20 /** This class is a "CSerializable" wrapper for "CMatrixFloat".
21  * \note For a complete introduction to Matrices and vectors in MRPT, see:
22  * http://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_classes
23  * \ingroup mrpt_base_grp
24  */
26 {
28 
29  public:
30  /** Constructor */
31  CMatrix() : CMatrixFloat(1, 1) {}
32  /** Constructor */
33  CMatrix(size_t row, size_t col) : CMatrixFloat(row, col) {}
34  /** Copy constructor
35  */
36  CMatrix(const CMatrixFloat& m) : CMatrixFloat(m) {}
37  /** Copy constructor
38  */
40  {
41  *this = m.eval().cast<float>();
42  }
43 
44  /** Constructor from a TPose2D, which generates a 3x1 matrix \f$ [x y
45  * \phi]^T \f$ */
46  explicit CMatrix(const TPose2D& p);
47  /** Constructor from a mrpt::poses::CPose6D, which generates a 6x1 matrix
48  * \f$ [x y z yaw pitch roll]^T \f$ */
49  explicit CMatrix(const TPose3D& p);
50  /** Constructor from a TPoint2D, which generates a 2x1 matrix \f$ [x y]^T
51  * \f$ */
52  explicit CMatrix(const TPoint2D& p);
53  /** Constructor from a TPoint3D, which generates a 3x1 matrix \f$ [x y z]^T
54  * \f$ */
55  explicit CMatrix(const TPoint3D& p);
56 
57  /** Assignment operator for float matrixes
58  */
59  template <class OTHERMAT>
60  inline CMatrix& operator=(const OTHERMAT& m)
61  {
62  CMatrixFloat::operator=(m);
63  return *this;
64  }
65 
66  /*! Assignment operator from any other Eigen class */
67  template <typename OtherDerived>
68  inline CMatrix& operator=(const Eigen::MatrixBase<OtherDerived>& other)
69  {
71  return *this;
72  }
73  /*! Constructor from any other Eigen class */
74  template <typename OtherDerived>
75  inline CMatrix(const Eigen::MatrixBase<OtherDerived>& other)
76  : CMatrixTemplateNumeric<float>(other)
77  {
78  }
79 
80 }; // end of class definition
82 
83 } // End of namespace
84 } // End of namespace
85 
86 #endif
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
This class is a "CSerializable" wrapper for "CMatrixFloat".
Definition: CMatrix.h:26
CMatrix(size_t row, size_t col)
Constructor
Definition: CMatrix.h:33
CMatrix(const CMatrixTemplateNumeric< double > &m)
Copy constructor.
Definition: CMatrix.h:39
CMatrix(const CMatrixFloat &m)
Copy constructor.
Definition: CMatrix.h:36
CMatrix & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CMatrix.h:68
std::shared_ptr< CMatrix > Ptr
Definition: CMatrix.h:27
CMatrix()
Constructor
Definition: CMatrix.h:31
CMatrix & operator=(const OTHERMAT &m)
Assignment operator for float matrixes.
Definition: CMatrix.h:60
CMatrix(const Eigen::MatrixBase< OtherDerived > &other)
Definition: CMatrix.h:75
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Definition: CSerializable.h:45
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:42
GLenum GLenum GLvoid * row
Definition: glext.h:3576
GLuint in
Definition: glext.h:7274
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CMatrix::Ptr &pObj)
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.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST