# rbdl / src / rbdl_eigenmath.h

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194``` ```/* * RBDL - Rigid Body Dynamics Library * Copyright (c) 2011-2012 Martin Felis * * Licensed under the zlib license. See LICENSE for more details. */ #ifndef _RBDL_EIGENMATH_H #define _RBDL_EIGENMATH_H class Vector3_t : public Eigen::Vector3d { public: typedef Eigen::Vector3d Base; template Vector3_t(const Eigen::MatrixBase& other) : Eigen::Vector3d(other) {} template Vector3_t& operator=(const Eigen::MatrixBase& other) { this->Base::operator=(other); return *this; } EIGEN_STRONG_INLINE Vector3_t() {} EIGEN_STRONG_INLINE Vector3_t( const double& v0, const double& v1, const double& v2 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) (*this) << v0, v1, v2; } void set(const double& v0, const double& v1, const double& v2) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) (*this) << v0, v1, v2; } }; class Matrix3_t : public Eigen::Matrix3d { public: typedef Eigen::Matrix3d Base; template Matrix3_t(const Eigen::MatrixBase& other) : Eigen::Matrix3d(other) {} template Matrix3_t& operator=(const Eigen::MatrixBase& other) { this->Base::operator=(other); return *this; } EIGEN_STRONG_INLINE Matrix3_t() {} EIGEN_STRONG_INLINE Matrix3_t( const double& m00, const double& m01, const double& m02, const double& m10, const double& m11, const double& m12, const double& m20, const double& m21, const double& m22 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix, 3, 3) (*this) << m00, m01, m02, m10, m11, m12, m20, m21, m22 ; } }; class SpatialVector_t : public Eigen::Matrix { public: typedef Eigen::Matrix Base; template SpatialVector_t(const Eigen::MatrixBase& other) : Eigen::Matrix(other) {} template SpatialVector_t& operator=(const Eigen::MatrixBase& other) { this->Base::operator=(other); return *this; } EIGEN_STRONG_INLINE SpatialVector_t() {} EIGEN_STRONG_INLINE SpatialVector_t( const double& v0, const double& v1, const double& v2, const double& v3, const double& v4, const double& v5 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 6) (*this) << v0, v1, v2, v3, v4, v5; } void set( const double& v0, const double& v1, const double& v2, const double& v3, const double& v4, const double& v5 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 6) (*this) << v0, v1, v2, v3, v4, v5; } }; class SpatialMatrix_t : public Eigen::Matrix { public: typedef Eigen::Matrix Base; template SpatialMatrix_t(const Eigen::MatrixBase& other) : Eigen::Matrix(other) {} template SpatialMatrix_t& operator=(const Eigen::MatrixBase& other) { this->Base::operator=(other); return *this; } EIGEN_STRONG_INLINE SpatialMatrix_t() {} EIGEN_STRONG_INLINE SpatialMatrix_t( const Scalar& m00, const Scalar& m01, const Scalar& m02, const Scalar& m03, const Scalar& m04, const Scalar& m05, const Scalar& m10, const Scalar& m11, const Scalar& m12, const Scalar& m13, const Scalar& m14, const Scalar& m15, const Scalar& m20, const Scalar& m21, const Scalar& m22, const Scalar& m23, const Scalar& m24, const Scalar& m25, const Scalar& m30, const Scalar& m31, const Scalar& m32, const Scalar& m33, const Scalar& m34, const Scalar& m35, const Scalar& m40, const Scalar& m41, const Scalar& m42, const Scalar& m43, const Scalar& m44, const Scalar& m45, const Scalar& m50, const Scalar& m51, const Scalar& m52, const Scalar& m53, const Scalar& m54, const Scalar& m55 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix, 6, 6) (*this) << m00, m01, m02, m03, m04, m05 , m10, m11, m12, m13, m14, m15 , m20, m21, m22, m23, m24, m25 , m30, m31, m32, m33, m34, m35 , m40, m41, m42, m43, m44, m45 , m50, m51, m52, m53, m54, m55 ; } void set( const Scalar& m00, const Scalar& m01, const Scalar& m02, const Scalar& m03, const Scalar& m04, const Scalar& m05, const Scalar& m10, const Scalar& m11, const Scalar& m12, const Scalar& m13, const Scalar& m14, const Scalar& m15, const Scalar& m20, const Scalar& m21, const Scalar& m22, const Scalar& m23, const Scalar& m24, const Scalar& m25, const Scalar& m30, const Scalar& m31, const Scalar& m32, const Scalar& m33, const Scalar& m34, const Scalar& m35, const Scalar& m40, const Scalar& m41, const Scalar& m42, const Scalar& m43, const Scalar& m44, const Scalar& m45, const Scalar& m50, const Scalar& m51, const Scalar& m52, const Scalar& m53, const Scalar& m54, const Scalar& m55 ) { Base::_check_template_params(); EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix, 6, 6) (*this) << m00, m01, m02, m03, m04, m05 , m10, m11, m12, m13, m14, m15 , m20, m21, m22, m23, m24, m25 , m30, m31, m32, m33, m34, m35 , m40, m41, m42, m43, m44, m45 , m50, m51, m52, m53, m54, m55 ; } }; #endif /* _RBDL_EIGENMATH_H */ ```