From 0aa752fc4fff4541c831ec7d4a12c566a71da56b Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Thu, 27 Jan 2011 09:14:22 -0500 Subject: add quaternion Options, add unaligned possibility --- Eigen/src/Geometry/Quaternion.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'Eigen/src/Geometry/Quaternion.h') diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index d9b34a385..ecf839335 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -215,28 +215,28 @@ public: */ namespace internal { -template -struct traits > +template +struct traits > { - typedef Quaternion<_Scalar> PlainObject; + typedef Quaternion<_Scalar,_Options> PlainObject; typedef _Scalar Scalar; - typedef Matrix<_Scalar,4,1> Coefficients; + typedef Matrix<_Scalar,4,1,_Options> Coefficients; enum{ - PacketAccess = Aligned + PacketAccess = _Options & DontAlign ? Unaligned : Aligned }; }; } -template -class Quaternion : public QuaternionBase >{ - typedef QuaternionBase > Base; +template +class Quaternion : public QuaternionBase >{ + typedef QuaternionBase > Base; public: typedef _Scalar Scalar; - EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion) + EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion) using Base::operator*=; - typedef typename internal::traits >::Coefficients Coefficients; + typedef typename internal::traits >::Coefficients Coefficients; typedef typename Base::AngleAxisType AngleAxisType; /** Default constructor leaving the quaternion uninitialized. */ @@ -272,6 +272,14 @@ public: protected: Coefficients m_coeffs; + +#ifndef EIGEN_PARSED_BY_DOXYGEN + EIGEN_STRONG_INLINE static void _check_template_params() + { + EIGEN_STATIC_ASSERT( (_Options & DontAlign) == _Options, + INVALID_MATRIX_TEMPLATE_PARAMETERS) + } +#endif }; /** \ingroup Geometry_Module -- cgit v1.2.3