diff --git a/Eigen/src/Array/Array.h b/Eigen/src/Array/Array.h index 8d5fb66a6..e9fabcc73 100644 --- a/Eigen/src/Array/Array.h +++ b/Eigen/src/Array/Array.h @@ -38,7 +38,7 @@ class Array { public: - typedef DenseStorageBase > Base; + typedef DenseStorageBase Base; EIGEN_DENSE_PUBLIC_INTERFACE(Array) enum { Options = _Options }; diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index f339a301d..c02e45074 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -57,8 +57,8 @@ * * \sa DenseBase::block(int,int,int,int), DenseBase::block(int,int), class VectorBlock */ -template -struct ei_traits > : ei_traits +template +struct ei_traits > : ei_traits { typedef typename ei_traits::Scalar Scalar; typedef typename ei_traits::StorageKind StorageKind; @@ -99,12 +99,12 @@ struct ei_traits > : e }; }; -template class Block - : public ei_dense_xpr_base >::type +template class Block + : public ei_dense_xpr_base >::type { public: - typedef typename XprType::template MakeBase< Block >::Type Base; + typedef typename XprType::template MakeBase::Type Base; EIGEN_DENSE_PUBLIC_INTERFACE(Block) class InnerIterator; @@ -230,8 +230,8 @@ template -class Block - : public MapBase > +class Block + : public MapBase > { public: diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index e93518dae..200d3087c 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -1,7 +1,7 @@ // This file is part of Eigen, a lightweight C++ template library // for linear algebra. // -// Copyright (C) 2006-2009 Benoit Jacob +// Copyright (C) 2007-2010 Benoit Jacob // Copyright (C) 2008-2010 Gael Guennebaud // // Eigen is free software; you can redistribute it and/or @@ -26,12 +26,7 @@ #ifndef EIGEN_DENSEBASE_H #define EIGEN_DENSEBASE_H -template struct ei_has_direct_access -{ - enum { ret = (ei_traits::Flags & DirectAccessBit) ? 1 : 0 }; -}; - -template::ret> +template::ret> struct ei_inner_stride_at_compile_time { enum { ret = ei_traits::InnerStrideAtCompileTime }; @@ -43,7 +38,7 @@ struct ei_inner_stride_at_compile_time enum { ret = 0 }; }; -template::ret> +template::ret> struct ei_outer_stride_at_compile_time { enum { ret = ei_traits::OuterStrideAtCompileTime }; diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 76547f9e2..c61a3f3f5 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -136,7 +136,7 @@ class Matrix /** \brief Base class typedef. * \sa DenseStorageBase */ - typedef DenseStorageBase > Base; + typedef DenseStorageBase Base; enum { Options = _Options }; diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 3e6fbf065..791fddda9 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -285,7 +285,7 @@ class GeneralProduct { ei_assert(m_lhs.rows() == dst.rows() && m_rhs.cols() == dst.cols()); ei_gemv_selector::ActualAccess)>::run(*this, dst, alpha); + bool(ei_blas_traits::HasUsableDirectAccess)>::run(*this, dst, alpha); } }; diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index c786b1b64..6cb86426a 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -87,7 +87,7 @@ template class Transpose const typename MatrixType::Nested m_matrix; }; -template::ret> +template::ret> struct ei_TransposeImpl_base { typedef typename ei_dense_xpr_base >::type type; diff --git a/Eigen/src/Core/util/BlasUtil.h b/Eigen/src/Core/util/BlasUtil.h index 43c49670b..0fe6d2911 100644 --- a/Eigen/src/Core/util/BlasUtil.h +++ b/Eigen/src/Core/util/BlasUtil.h @@ -158,14 +158,14 @@ template struct ei_blas_traits IsComplex = NumTraits::IsComplex, IsTransposed = false, NeedToConjugate = false, - ActualAccess = ( (int(XprType::Flags)&DirectAccessBit) + HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit) && ( /* Uncomment this when the low-level matrix-vector product functions support strided vectors bool(XprType::IsVectorAtCompileTime) || */ int(ei_inner_stride_at_compile_time::ret) == 1) - ) ? HasDirectAccess : NoDirectAccess + ) ? 1 : 0 }; - typedef typename ei_meta_if::ret DirectLinearAccessType; @@ -226,7 +226,7 @@ struct ei_blas_traits > typedef Transpose XprType; typedef Transpose ExtractType; typedef Transpose _ExtractType; - typedef typename ei_meta_if::ret DirectLinearAccessType; @@ -237,7 +237,7 @@ struct ei_blas_traits > static inline Scalar extractScalarFactor(const XprType& x) { return Base::extractScalarFactor(x.nestedExpression()); } }; -template::ActualAccess> +template::HasUsableDirectAccess> struct ei_extract_data_selector { static const typename T::Scalar* run(const T& m) { @@ -246,7 +246,7 @@ struct ei_extract_data_selector { }; template -struct ei_extract_data_selector { +struct ei_extract_data_selector { static typename T::Scalar* run(const T&) { return 0; } }; diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h index 023ef3852..a586f2a5d 100644 --- a/Eigen/src/Core/util/Constants.h +++ b/Eigen/src/Core/util/Constants.h @@ -241,9 +241,7 @@ namespace { enum { IsDense = 0, - IsSparse, - NoDirectAccess = 0, - HasDirectAccess = DirectAccessBit + IsSparse }; enum TransformTraits { diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index faee3be8e..e384ba2df 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -49,17 +49,16 @@ template class NestByValue; template class ForceAlignedAccess; template class SwapWrapper; -// MSVC has a big bug: when the expression ei_traits::Flags&DirectAccessBit ? HasDirectAccess : NoDirectAccess +// MSVC has a big bug: when the expression ei_traits::Flags&DirectAccessBit ? 1 : 0 // is used as default template parameter value here, it gets mis-evaluated as just ei_traits::Flags // Moreover, adding brackets tends to give compilation errors with MSVC. // Solution: defer that to a helper struct. -template -struct ei_block_direct_access_status +template struct ei_has_direct_access { - enum { ret = ei_traits::Flags&DirectAccessBit ? HasDirectAccess : NoDirectAccess }; + enum { ret = (ei_traits::Flags & DirectAccessBit) ? 1 : 0 }; }; template::ret> class Block; + bool HasDirectAccess = ei_has_direct_access::ret> class Block; template class VectorBlock; template class Transpose;