From d5f3b2dc943a712a92834cebaea8bb9caae2f6e9 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 14 Dec 2009 17:26:24 -0500 Subject: change the Arch constants: const int ---> enum, more explicit names, and use of a namespace instead of Prefix_Name. --- Eigen/src/Core/util/Constants.h | 21 ++++++++++++--------- Eigen/src/Geometry/OrthoMethods.h | 5 +++-- Eigen/src/Geometry/Quaternion.h | 2 +- Eigen/src/Geometry/arch/Geometry_SSE.h | 6 ++++-- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h index 5489d063a..1128876f8 100644 --- a/Eigen/src/Core/util/Constants.h +++ b/Eigen/src/Core/util/Constants.h @@ -228,8 +228,7 @@ enum { RowMajor = 0x1, // it is only a coincidence that this is equal to RowMajorBit -- don't rely on that /** \internal Align the matrix itself if it is vectorizable fixed-size */ AutoAlign = 0, - /** \internal Don't require alignment for the matrix itself (the array of coefficients, if dynamically allocated, may still be - requested to be aligned) */ + /** \internal Don't require alignment for the matrix itself (the array of coefficients, if dynamically allocated, may still be requested to be aligned) */ // FIXME --- clarify the situation DontAlign = 0x2 }; @@ -277,16 +276,20 @@ enum TransformTraits { Projective = 0x20 }; -const int EiArch_Generic = 0x0; -const int EiArch_SSE = 0x1; -const int EiArch_AltiVec = 0x2; - +namespace Architecture +{ + enum Type { + Generic = 0x0, + SSE = 0x1, + AltiVec = 0x2, #if defined EIGEN_VECTORIZE_SSE - const int EiArch = EiArch_SSE; + Target = SSE #elif defined EIGEN_VECTORIZE_ALTIVEC - const int EiArch = EiArch_AltiVec; + Target = AltiVec #else - const int EiArch = EiArch_Generic; + Target = Generic #endif + }; +} #endif // EIGEN_CONSTANTS_H diff --git a/Eigen/src/Geometry/OrthoMethods.h b/Eigen/src/Geometry/OrthoMethods.h index 6d4a8f673..d16b72c43 100644 --- a/Eigen/src/Geometry/OrthoMethods.h +++ b/Eigen/src/Geometry/OrthoMethods.h @@ -90,8 +90,9 @@ MatrixBase::cross3(const MatrixBase& other) const const DerivedNested lhs(derived()); const OtherDerivedNested rhs(other.derived()); - return ei_cross3_impl::type, - typename ei_cleantype::type>::run(lhs,rhs); + return ei_cross3_impl::type, + typename ei_cleantype::type>::run(lhs,rhs); } /** \returns a matrix expression of the cross product of each column or row diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index b6eb74d66..861eff19c 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -367,7 +367,7 @@ QuaternionBase::operator* (const QuaternionBase& other) c { EIGEN_STATIC_ASSERT((ei_is_same_type::ret), YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - return ei_quat_product::Scalar, ei_traits::PacketAccess && ei_traits::PacketAccess>::run(*this, other); } diff --git a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h index a6ed10d82..297932f92 100644 --- a/Eigen/src/Geometry/arch/Geometry_SSE.h +++ b/Eigen/src/Geometry/arch/Geometry_SSE.h @@ -26,7 +26,8 @@ #ifndef EIGEN_GEOMETRY_SSE_H #define EIGEN_GEOMETRY_SSE_H -template struct ei_quat_product +template +struct ei_quat_product { inline static Quaternion run(const QuaternionBase& _a, const QuaternionBase& _b) { @@ -48,7 +49,8 @@ template struct ei_quat_product -struct ei_cross3_impl { +struct ei_cross3_impl +{ inline static typename ei_plain_matrix_type::type run(const VectorLhs& lhs, const VectorRhs& rhs) { -- cgit v1.2.3