diff options
author | 2015-08-06 15:31:07 +0200 | |
---|---|---|
committer | 2015-08-06 15:31:07 +0200 | |
commit | 1f5024332e47f295c991c3781d57d0466d41a9c8 (patch) | |
tree | 154fa01d41076ca58bdbff8c3bb0850119df92fa /Eigen/src/Geometry/Quaternion.h | |
parent | 65186ef18d6212b3d09b1d619f1cf1019c2ae0fb (diff) |
First part of a big refactoring of alignment control to enable the handling of arbitrarily aligned buffers. It includes:
- AlignedBit flag is deprecated. Alignment is now specified by the evaluator through the 'Alignment' enum, e.g., evaluator<Xpr>::Alignment. Its value is in Bytes.
- Add several enums to specify alignment: Aligned8, Aligned16, Aligned32, Aligned64, Aligned128. AlignedMax corresponds to EIGEN_MAX_ALIGN_BYTES. Such enums are used to define the above Alignment value, and as the 'Options' template parameter of Map<> and Ref<>.
- The Aligned enum is now deprecated. It is now an alias for Aligned16.
- Currently, traits<Matrix<>>, traits<Array<>>, traits<Ref<>>, traits<Map<>>, and traits<Block<>> also expose the Alignment enum.
Diffstat (limited to 'Eigen/src/Geometry/Quaternion.h')
-rw-r--r-- | Eigen/src/Geometry/Quaternion.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 15a063994..7a30dc0b6 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -217,8 +217,8 @@ struct traits<Quaternion<_Scalar,_Options> > typedef _Scalar Scalar; typedef Matrix<_Scalar,4,1,_Options> Coefficients; enum{ - IsAligned = (internal::traits<Coefficients>::EvaluatorFlags & AlignedBit) != 0, - Flags = IsAligned ? (AlignedBit | LvalueBit) : LvalueBit + Alignment = internal::traits<Coefficients>::Alignment, + Flags = LvalueBit }; }; } @@ -228,7 +228,7 @@ class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> > { public: typedef QuaternionBase<Quaternion<_Scalar,_Options> > Base; - enum { IsAligned = internal::traits<Quaternion>::IsAligned }; + enum { NeedsAlignment = internal::traits<Quaternion>::Alignment>0 }; typedef _Scalar Scalar; @@ -277,7 +277,7 @@ public: inline Coefficients& coeffs() { return m_coeffs;} inline const Coefficients& coeffs() const { return m_coeffs;} - EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(IsAligned) + EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsAlignment) protected: Coefficients m_coeffs; @@ -441,7 +441,7 @@ QuaternionBase<Derived>::operator* (const QuaternionBase<OtherDerived>& other) c YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) return internal::quat_product<Architecture::Target, Derived, OtherDerived, typename internal::traits<Derived>::Scalar, - (internal::traits<Derived>::IsAligned && internal::traits<OtherDerived>::IsAligned)?Aligned:Unaligned>::run(*this, other); + EIGEN_PLAIN_ENUM_MIN(internal::traits<Derived>::Alignment, internal::traits<OtherDerived>::Alignment)>::run(*this, other); } /** \sa operator*(Quaternion) */ @@ -668,7 +668,7 @@ QuaternionBase<Derived>::conjugate() const { return internal::quat_conj<Architecture::Target, Derived, typename internal::traits<Derived>::Scalar, - internal::traits<Derived>::IsAligned?Aligned:Unaligned>::run(*this); + internal::traits<Derived>::Alignment>::run(*this); } |