From 2e9f7f80bf76cc2e7f11a3fcca5f71e635be81ed Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 31 Jul 2009 10:04:34 +0200 Subject: compilation fixes for sun CC --- Eigen/src/Geometry/Homogeneous.h | 6 +++-- Eigen/src/Geometry/RotationBase.h | 49 +++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 25 deletions(-) (limited to 'Eigen/src/Geometry') diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 530725d90..5f4cddcea 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -62,11 +62,13 @@ struct ei_traits > template struct ei_homogeneous_left_product_impl; template struct ei_homogeneous_right_product_impl; -template class Homogeneous - : public MatrixBase > +template class Homogeneous + : public MatrixBase > { public: + enum { Direction = _Direction }; + EIGEN_GENERIC_PUBLIC_INTERFACE(Homogeneous) inline Homogeneous(const MatrixType& matrix) diff --git a/Eigen/src/Geometry/RotationBase.h b/Eigen/src/Geometry/RotationBase.h index 632ea3991..7a4307ee7 100644 --- a/Eigen/src/Geometry/RotationBase.h +++ b/Eigen/src/Geometry/RotationBase.h @@ -25,8 +25,9 @@ #ifndef EIGEN_ROTATIONBASE_H #define EIGEN_ROTATIONBASE_H -// this file aims to contains the various representations of rotation/orientation -// in 2D and 3D space excepted Matrix and Quaternion. +// forward declaration +template +struct ei_rotation_base_generic_product_selector; /** \class RotationBase * @@ -47,25 +48,6 @@ class RotationBase typedef Matrix RotationMatrixType; typedef Matrix VectorType; - protected: - template - struct generic_product_selector - { - typedef RotationMatrixType ReturnType; - inline static RotationMatrixType run(const Derived& r, const MatrixType& m) - { return r.toRotationMatrix() * m; } - }; - - template - struct generic_product_selector - { - typedef VectorType ReturnType; - inline static VectorType run(const Derived& r, const OtherVectorType& v) - { - return r._transformVector(v); - } - }; - public: inline const Derived& derived() const { return *static_cast(this); } inline Derived& derived() { return *static_cast(this); } @@ -90,9 +72,9 @@ class RotationBase * - a vector of size Dim */ template - inline typename generic_product_selector::ReturnType + inline typename ei_rotation_base_generic_product_selector::ReturnType operator*(const MatrixBase& e) const - { return generic_product_selector::run(derived(), e.derived()); } + { return ei_rotation_base_generic_product_selector::run(derived(), e.derived()); } /** \returns the concatenation of a linear transformation \a l with the rotation \a r */ template friend @@ -109,6 +91,27 @@ class RotationBase { return toRotationMatrix() * v; } }; +// implementation of the generic product rotation * matrix +template +struct ei_rotation_base_generic_product_selector +{ + enum { Dim = RotationDerived::Dim }; + typedef Matrix ReturnType; + inline static ReturnType run(const RotationDerived& r, const MatrixType& m) + { return r.toRotationMatrix() * m; } +}; + +template +struct ei_rotation_base_generic_product_selector +{ + enum { Dim = RotationDerived::Dim }; + typedef Matrix ReturnType; + inline static ReturnType run(const RotationDerived& r, const OtherVectorType& v) + { + return r._transformVector(v); + } +}; + /** \geometry_module * * Constructs a Dim x Dim rotation matrix from the rotation \a r -- cgit v1.2.3