From 125619146bc3db3074c8f7632869c7f85b857b8a Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 16 Sep 2014 16:06:32 -0700 Subject: [PATCH] workaround weird MSVC compilation issue: a typdedef in a base class shadows a template parameter of a derived class --- Eigen/src/SparseCore/SparseDenseProduct.h | 37 +++++++++++------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Eigen/src/SparseCore/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h index c8a515e8c..803d98e2d 100644 --- a/Eigen/src/SparseCore/SparseDenseProduct.h +++ b/Eigen/src/SparseCore/SparseDenseProduct.h @@ -402,30 +402,30 @@ struct generic_product_impl } }; -template +template struct sparse_dense_outer_product_evaluator { protected: - typedef typename conditional::type Lhs1; - typedef typename conditional::type Rhs; - typedef Product ProdXprType; + typedef typename conditional::type Lhs1; + typedef typename conditional::type ActualRhs; + typedef Product ProdXprType; // if the actual left-hand side is a dense vector, // then build a sparse-view so that we can seamlessly iterator over it. typedef typename conditional::StorageKind,Sparse>::value, - Lhs1, SparseView >::type Lhs; + Lhs1, SparseView >::type ActualLhs; typedef typename conditional::StorageKind,Sparse>::value, Lhs1 const&, SparseView >::type LhsArg; - typedef typename evaluator::type LhsEval; - typedef typename evaluator::type RhsEval; - typedef typename evaluator::InnerIterator LhsIterator; + typedef typename evaluator::type LhsEval; + typedef typename evaluator::type RhsEval; + typedef typename evaluator::InnerIterator LhsIterator; typedef typename ProdXprType::Scalar Scalar; typedef typename ProdXprType::Index Index; public: enum { - Flags = Transpose ? RowMajorBit : 0, + Flags = NeedToTranspose ? RowMajorBit : 0, CoeffReadCost = Dynamic }; @@ -436,17 +436,16 @@ public: : LhsIterator(xprEval.m_lhsXprImpl, 0), m_outer(outer), m_empty(false), - m_factor(get(xprEval.m_rhsXprImpl, outer, typename internal::traits::StorageKind() )) + m_factor(get(xprEval.m_rhsXprImpl, outer, typename internal::traits::StorageKind() )) {} EIGEN_STRONG_INLINE Index outer() const { return m_outer; } - EIGEN_STRONG_INLINE Index row() const { return Transpose ? m_outer : LhsIterator::index(); } - EIGEN_STRONG_INLINE Index col() const { return Transpose ? LhsIterator::index() : m_outer; } + EIGEN_STRONG_INLINE Index row() const { return NeedToTranspose ? m_outer : LhsIterator::index(); } + EIGEN_STRONG_INLINE Index col() const { return NeedToTranspose ? LhsIterator::index() : m_outer; } EIGEN_STRONG_INLINE Scalar value() const { return LhsIterator::value() * m_factor; } EIGEN_STRONG_INLINE operator bool() const { return LhsIterator::operator bool() && (!m_empty); } - protected: Scalar get(const RhsEval &rhs, Index outer, Dense = Dense()) const { @@ -467,19 +466,19 @@ public: Scalar m_factor; }; - sparse_dense_outer_product_evaluator(const Lhs &lhs, const Rhs &rhs) - : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) + sparse_dense_outer_product_evaluator(const ActualLhs &lhs, const ActualRhs &rhs) + : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) {} // transpose case - sparse_dense_outer_product_evaluator(const Rhs &rhs, const Lhs1 &lhs) - : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) + sparse_dense_outer_product_evaluator(const ActualRhs &rhs, const Lhs1 &lhs) + : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) {} protected: const LhsArg m_lhs; - typename evaluator::nestedType m_lhsXprImpl; - typename evaluator::nestedType m_rhsXprImpl; + typename evaluator::nestedType m_lhsXprImpl; + typename evaluator::nestedType m_rhsXprImpl; }; // sparse * dense outer product