Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CMATRIXD_H
00029 #define CMATRIXD_H
00030
00031 #include <mrpt/utils/CSerializable.h>
00032 #include <mrpt/math/CMatrixTemplateNumeric.h>
00033 #include <mrpt/utils/CStream.h>
00034 #include <mrpt/utils/utils_defs.h>
00035
00036
00037 namespace mrpt
00038 {
00039 namespace math
00040 {
00041
00042
00043
00044 DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(CMatrixD, mrpt::utils::CSerializable, CMatrixD)
00045 BASE_IMPEXP ::mrpt::utils::CStream& operator>>(mrpt::utils::CStream& in, CMatrixDPtr &pObj);
00046
00047
00048
00049
00050
00051
00052 class BASE_IMPEXP_TEMPL CMatrixD : public mrpt::utils::CSerializable, public CMatrixTemplateNumeric<double>
00053 {
00054
00055
00056
00057 protected:
00058 static const mrpt::utils::TRuntimeClassId* _GetBaseClass();
00059 static mrpt::utils::CLASSINIT _init_CMatrixD;
00060 public:
00061
00062 typedef CMatrixDPtr SmartPtr;
00063 static BASE_IMPEXP mrpt::utils::TRuntimeClassId classCMatrixD;
00064 static BASE_IMPEXP const mrpt::utils::TRuntimeClassId *classinfo;
00065 virtual BASE_IMPEXP const mrpt::utils::TRuntimeClassId* GetRuntimeClass() const;
00066 static BASE_IMPEXP mrpt::utils::CObject* CreateObject();
00067 static BASE_IMPEXP CMatrixDPtr Create();
00068 virtual BASE_IMPEXP mrpt::utils::CObject *duplicate() const;
00069 protected:
00070
00071
00072 BASE_IMPEXP void writeToStream(mrpt::utils::CStream &out, int *getVersion) const;
00073 BASE_IMPEXP void readFromStream(mrpt::utils::CStream &in, int version);
00074
00075
00076 public:
00077
00078 CMatrixD() : CMatrixTemplateNumeric<double>(1,1)
00079 { }
00080
00081
00082 CMatrixD(size_t row, size_t col) : CMatrixTemplateNumeric<double>(row,col)
00083 { }
00084
00085
00086 CMatrixD( const CMatrixTemplateNumeric<double> &m ) : CMatrixTemplateNumeric<double>(m)
00087 { }
00088
00089
00090
00091 CMatrixD( const CMatrixFloat &m ) : CMatrixTemplateNumeric<double>(0,0)
00092 {
00093 *this = m.eval().cast<double>();
00094 }
00095
00096
00097 template<typename OtherDerived>
00098 inline CMatrixD & operator= (const Eigen::MatrixBase <OtherDerived>& other) {
00099 CMatrixTemplateNumeric<double>::operator=(other);
00100 return *this;
00101 }
00102
00103 template<typename OtherDerived>
00104 inline CMatrixD(const Eigen::MatrixBase <OtherDerived>& other) : CMatrixTemplateNumeric<double>(other) { }
00105
00106
00107
00108 explicit CMatrixD( const TPose2D &p) : CMatrixDouble(p) {}
00109
00110
00111
00112 explicit CMatrixD( const TPose3D &p) : CMatrixDouble(p) {}
00113
00114
00115
00116 explicit CMatrixD( const TPoint2D &p) : CMatrixDouble(p) {}
00117
00118
00119
00120 explicit CMatrixD( const TPoint3D &p) : CMatrixDouble(p) {}
00121
00122
00123
00124
00125 template <class OTHERMAT>
00126 inline CMatrixD & operator = (const OTHERMAT& m)
00127 {
00128 CMatrixDouble::operator =(m);
00129 return *this;
00130 }
00131
00132 };
00133
00134 }
00135 }
00136
00137 #endif