diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
commit | 4716040703be1ee906439385d20475dcddad5ce3 (patch) | |
tree | 8efd3cf3007d8360e66f38e2d280127cbb70daa6 /Eigen/src/Geometry/RotationBase.h | |
parent | ca85a1f6c5fc33ac382aa2d7ba2da63d55d3223e (diff) |
bug #86 : use internal:: namespace instead of ei_ prefix
Diffstat (limited to 'Eigen/src/Geometry/RotationBase.h')
-rw-r--r-- | Eigen/src/Geometry/RotationBase.h | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/Eigen/src/Geometry/RotationBase.h b/Eigen/src/Geometry/RotationBase.h index 181e65be9..65b9cd834 100644 --- a/Eigen/src/Geometry/RotationBase.h +++ b/Eigen/src/Geometry/RotationBase.h @@ -26,8 +26,10 @@ #define EIGEN_ROTATIONBASE_H // forward declaration +namespace internal { template<typename RotationDerived, typename MatrixType, bool IsVector=MatrixType::IsVectorAtCompileTime> -struct ei_rotation_base_generic_product_selector; +struct rotation_base_generic_product_selector; +} /** \class RotationBase * @@ -42,7 +44,7 @@ class RotationBase public: enum { Dim = _Dim }; /** the scalar type of the coefficients */ - typedef typename ei_traits<Derived>::Scalar Scalar; + typedef typename internal::traits<Derived>::Scalar Scalar; /** corresponding linear transformation matrix type */ typedef Matrix<Scalar,Dim,Dim> RotationMatrixType; @@ -78,9 +80,9 @@ class RotationBase * - a vector of size Dim */ template<typename OtherDerived> - EIGEN_STRONG_INLINE typename ei_rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType + EIGEN_STRONG_INLINE typename internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType operator*(const EigenBase<OtherDerived>& e) const - { return ei_rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); } + { return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); } /** \returns the concatenation of a linear transformation \a l with the rotation \a r */ template<typename OtherDerived> friend @@ -105,9 +107,11 @@ class RotationBase { return toRotationMatrix() * v; } }; +namespace internal { + // implementation of the generic product rotation * matrix template<typename RotationDerived, typename MatrixType> -struct ei_rotation_base_generic_product_selector<RotationDerived,MatrixType,false> +struct rotation_base_generic_product_selector<RotationDerived,MatrixType,false> { enum { Dim = RotationDerived::Dim }; typedef Matrix<typename RotationDerived::Scalar,Dim,Dim> ReturnType; @@ -116,7 +120,7 @@ struct ei_rotation_base_generic_product_selector<RotationDerived,MatrixType,fals }; template<typename RotationDerived, typename Scalar, int Dim, int MaxDim> -struct ei_rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false > +struct rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false > { typedef Transform<Scalar,Dim,Affine> ReturnType; inline static ReturnType run(const RotationDerived& r, const DiagonalMatrix<Scalar,Dim,MaxDim>& m) @@ -128,7 +132,7 @@ struct ei_rotation_base_generic_product_selector< RotationDerived, DiagonalMatri }; template<typename RotationDerived,typename OtherVectorType> -struct ei_rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true> +struct rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true> { enum { Dim = RotationDerived::Dim }; typedef Matrix<typename RotationDerived::Scalar,Dim,1> ReturnType; @@ -138,6 +142,8 @@ struct ei_rotation_base_generic_product_selector<RotationDerived,OtherVectorType } }; +} // end namespace internal + /** \geometry_module * * \brief Constructs a Dim x Dim rotation matrix from the rotation \a r @@ -165,6 +171,8 @@ Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols> return *this = r.toRotationMatrix(); } +namespace internal { + /** \internal * * Helper function to return an arbitrary rotation object to a rotation matrix. @@ -179,29 +187,31 @@ Matrix<_Scalar, _Rows, _Cols, _Storage, _MaxRows, _MaxCols> * - any matrix expression, * - any type based on RotationBase (e.g., Quaternion, AngleAxis, Rotation2D) * - * Currently ei_toRotationMatrix is only used by Transform. + * Currently toRotationMatrix is only used by Transform. * * \sa class Transform, class Rotation2D, class Quaternion, class AngleAxis */ template<typename Scalar, int Dim> -inline static Matrix<Scalar,2,2> ei_toRotationMatrix(const Scalar& s) +inline static Matrix<Scalar,2,2> toRotationMatrix(const Scalar& s) { EIGEN_STATIC_ASSERT(Dim==2,YOU_MADE_A_PROGRAMMING_MISTAKE) return Rotation2D<Scalar>(s).toRotationMatrix(); } template<typename Scalar, int Dim, typename OtherDerived> -inline static Matrix<Scalar,Dim,Dim> ei_toRotationMatrix(const RotationBase<OtherDerived,Dim>& r) +inline static Matrix<Scalar,Dim,Dim> toRotationMatrix(const RotationBase<OtherDerived,Dim>& r) { return r.toRotationMatrix(); } template<typename Scalar, int Dim, typename OtherDerived> -inline static const MatrixBase<OtherDerived>& ei_toRotationMatrix(const MatrixBase<OtherDerived>& mat) +inline static const MatrixBase<OtherDerived>& toRotationMatrix(const MatrixBase<OtherDerived>& mat) { EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim, YOU_MADE_A_PROGRAMMING_MISTAKE) return mat; } +} // end namespace internal + #endif // EIGEN_ROTATIONBASE_H |