diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-08-24 16:00:17 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-08-24 16:00:17 +0000 |
commit | bf17467ce0418e0e9b759899f1af713f2376be1f (patch) | |
tree | e486d945dcebf510700500d376402e8c4edbf2f5 /Eigen | |
parent | 440664cd5dc20fd0f09d46fbf69ca72d34ae8e93 (diff) |
bugfix in Product and ei_L2_block_traits
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/CacheFriendlyProduct.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Product.h | 10 | ||||
-rw-r--r-- | Eigen/src/Core/util/Meta.h | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/Eigen/src/Core/CacheFriendlyProduct.h b/Eigen/src/Core/CacheFriendlyProduct.h index 051477cad..ff8314aa3 100644 --- a/Eigen/src/Core/CacheFriendlyProduct.h +++ b/Eigen/src/Core/CacheFriendlyProduct.h @@ -27,7 +27,7 @@ template <int L2MemorySize,typename Scalar> struct ei_L2_block_traits { - enum {width = ei_meta_sqrt<L2MemorySize/(64*sizeof(Scalar))>::ret }; + enum {width = 8 * ei_meta_sqrt<L2MemorySize/(64*sizeof(Scalar))>::ret }; }; #ifndef EIGEN_EXTERN_INSTANTIATIONS diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index e31a89dcc..f18bc1e4a 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -60,8 +60,7 @@ struct ProductReturnType typedef typename ei_nested<Lhs,Rhs::ColsAtCompileTime>::type LhsNested; typedef typename ei_nested<Rhs,Lhs::RowsAtCompileTime>::type RhsNested; - typedef Product<typename ei_unconst<LhsNested>::type, - typename ei_unconst<RhsNested>::type, ProductMode> Type; + typedef Product<LhsNested, RhsNested, ProductMode> Type; }; // cache friendly specialization @@ -71,11 +70,10 @@ struct ProductReturnType<Lhs,Rhs,CacheFriendlyProduct> typedef typename ei_nested<Lhs,Rhs::ColsAtCompileTime>::type LhsNested; typedef typename ei_nested<Rhs,Lhs::RowsAtCompileTime, - typename ei_product_eval_to_column_major<Rhs>::type - >::type RhsNested; + typename ei_product_eval_to_column_major<Rhs>::type + >::type RhsNested; - typedef Product<typename ei_unconst<LhsNested>::type, - typename ei_unconst<RhsNested>::type, CacheFriendlyProduct> Type; + typedef Product<LhsNested, RhsNested, CacheFriendlyProduct> Type; }; /* Helper class to determine the type of the product, can be either: diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index bbb780053..3ee24fb7a 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -54,7 +54,11 @@ template<typename T> struct ei_unpointer<T*const> { typedef T type; }; template<typename T> struct ei_unconst { typedef T type; }; template<typename T> struct ei_unconst<const T> { typedef T type; }; -// template<typename T> struct ei_unconst<const T&> { typedef T& type; }; +template<typename T> struct ei_unconst<T const &> { typedef T & type; }; +template<typename T> struct ei_unconst<T const *> { typedef T * type; }; +template<typename T> struct ei_unconst<T const volatile> { typedef T volatile type; }; +template<typename T> struct ei_unconst<T const volatile &> { typedef T volatile & type; }; +template<typename T> struct ei_unconst<T const volatile *> { typedef T volatile * type; }; template<typename T> struct ei_cleantype { typedef T type; }; template<typename T> struct ei_cleantype<const T> { typedef typename ei_cleantype<T>::type type; }; |