From 92b9f0e102b35c3091bdeea3fc65f38f0e93c612 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 2 Sep 2015 21:38:40 +0200 Subject: [PATCH] Cleaning pass on evaluators: remove the useless and error prone evaluator<>::type indirection. --- Eigen/src/Core/AssignEvaluator.h | 4 +-- Eigen/src/Core/BooleanRedux.h | 4 +-- Eigen/src/Core/CoreEvaluators.h | 25 ++++++++----------- Eigen/src/Core/CoreIterators.h | 6 ++--- Eigen/src/Core/DenseCoeffsBase.h | 12 ++++----- Eigen/src/Core/Inverse.h | 5 ++-- Eigen/src/Core/Product.h | 6 ++--- Eigen/src/Core/ProductEvaluators.h | 15 +++++------ Eigen/src/Core/ReturnByValue.h | 5 ++-- Eigen/src/Core/Solve.h | 5 ++-- Eigen/src/Core/TriangularMatrix.h | 5 ++-- Eigen/src/Geometry/Homogeneous.h | 10 +++++--- .../IterativeLinearSolvers/SolveWithGuess.h | 5 ++-- Eigen/src/LU/InverseImpl.h | 2 +- .../ConservativeSparseSparseProduct.h | 4 +-- Eigen/src/SparseCore/SparseAssign.h | 12 ++++----- Eigen/src/SparseCore/SparseBlock.h | 2 +- Eigen/src/SparseCore/SparseCwiseBinaryOp.h | 6 ++--- Eigen/src/SparseCore/SparseDenseProduct.h | 12 ++++----- Eigen/src/SparseCore/SparseDiagonalProduct.h | 4 +-- Eigen/src/SparseCore/SparseDot.h | 6 ++--- Eigen/src/SparseCore/SparsePermutation.h | 8 +++--- Eigen/src/SparseCore/SparseProduct.h | 5 ++-- Eigen/src/SparseCore/SparseRedux.h | 2 +- Eigen/src/SparseCore/SparseSelfAdjointView.h | 10 ++++---- .../SparseSparseProductWithPruning.h | 4 +-- Eigen/src/SparseCore/SparseTriangularView.h | 2 +- Eigen/src/SparseCore/SparseVector.h | 4 +-- Eigen/src/SparseCore/TriangularSolver.h | 8 +++--- 29 files changed, 92 insertions(+), 106 deletions(-) diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index 2b00d355b..c4ba60d6d 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -647,8 +647,8 @@ EIGEN_DEVICE_FUNC void call_dense_assignment_loop(const DstXprType& dst, const S { eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); - typedef typename evaluator::type DstEvaluatorType; - typedef typename evaluator::type SrcEvaluatorType; + typedef evaluator DstEvaluatorType; + typedef evaluator SrcEvaluatorType; DstEvaluatorType dstEvaluator(dst); SrcEvaluatorType srcEvaluator(src); diff --git a/Eigen/src/Core/BooleanRedux.h b/Eigen/src/Core/BooleanRedux.h index 31fbb9214..ba45cf5c3 100644 --- a/Eigen/src/Core/BooleanRedux.h +++ b/Eigen/src/Core/BooleanRedux.h @@ -80,7 +80,7 @@ struct any_unroller template inline bool DenseBase::all() const { - typedef typename internal::evaluator::type Evaluator; + typedef internal::evaluator Evaluator; enum { unroll = SizeAtCompileTime != Dynamic && Evaluator::CoeffReadCost != Dynamic @@ -106,7 +106,7 @@ inline bool DenseBase::all() const template inline bool DenseBase::any() const { - typedef typename internal::evaluator::type Evaluator; + typedef internal::evaluator Evaluator; enum { unroll = SizeAtCompileTime != Dynamic && Evaluator::CoeffReadCost != Dynamic diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 26df269a0..1541f940e 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -59,11 +59,6 @@ template< typename T, template struct evaluator_traits_base { - // TODO check whether these two indirections are really needed. - // Basically, if nobody overwrite type and nestedType, then, they can be dropped -// typedef evaluator type; -// typedef evaluator nestedType; - // by default, get evaluator kind and shape from storage typedef typename storage_kind_to_evaluator_kind::StorageKind>::Kind Kind; typedef typename storage_kind_to_shape::StorageKind>::Shape Shape; @@ -90,25 +85,26 @@ struct evaluator : public unary_evaluator // TODO: Think about const-correctness - template struct evaluator : evaluator -{ }; +{ + typedef evaluator nestedType; + explicit evaluator(const T& xpr) : evaluator(xpr) {} +}; -// ---------- base class for all writable evaluators ---------- +// ---------- base class for all evaluators ---------- -// TODO this class does not seem to be necessary anymore template struct evaluator_base { -// typedef typename evaluator_traits::type type; -// typedef typename evaluator_traits::nestedType nestedType; - typedef evaluator type; + // TODO Check whether nestedType is really needed: + // As long as evaluator are non-copyable, there is no reason to make it different. typedef evaluator nestedType; // FIXME is it really usefull? typedef typename traits::StorageIndex StorageIndex; + // TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices. typedef traits ExpressionTraits; @@ -1332,13 +1328,12 @@ class EvalToTemp template struct evaluator > - : public evaluator::type + : public evaluator { typedef EvalToTemp XprType; typedef typename ArgType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) diff --git a/Eigen/src/Core/CoreIterators.h b/Eigen/src/Core/CoreIterators.h index c76bdf68e..4eb42b93a 100644 --- a/Eigen/src/Core/CoreIterators.h +++ b/Eigen/src/Core/CoreIterators.h @@ -34,7 +34,7 @@ class InnerIterator { protected: typedef internal::inner_iterator_selector::Kind> IteratorType; - typedef typename internal::evaluator::type EvaluatorType; + typedef internal::evaluator EvaluatorType; typedef typename internal::traits::Scalar Scalar; public: /** Construct an iterator over the \a outerId -th row or column of \a xpr */ @@ -74,7 +74,7 @@ template class inner_iterator_selector { protected: - typedef typename evaluator::type EvaluatorType; + typedef evaluator EvaluatorType; typedef typename traits::Scalar Scalar; enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit }; @@ -112,7 +112,7 @@ class inner_iterator_selector { protected: typedef typename evaluator::InnerIterator Base; - typedef typename evaluator::type EvaluatorType; + typedef evaluator EvaluatorType; public: EIGEN_STRONG_INLINE inner_iterator_selector(const EvaluatorType &eval, const Index &outerId, const Index &/*innerSize*/) diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h index 81b0d6017..9581757f3 100644 --- a/Eigen/src/Core/DenseCoeffsBase.h +++ b/Eigen/src/Core/DenseCoeffsBase.h @@ -97,7 +97,7 @@ class DenseCoeffsBase : public EigenBase { eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); - return typename internal::evaluator::type(derived()).coeff(row,col); + return internal::evaluator(derived()).coeff(row,col); } EIGEN_DEVICE_FUNC @@ -139,7 +139,7 @@ class DenseCoeffsBase : public EigenBase coeff(Index index) const { eigen_internal_assert(index >= 0 && index < size()); - return typename internal::evaluator::type(derived()).coeff(index); + return internal::evaluator(derived()).coeff(index); } @@ -218,7 +218,7 @@ class DenseCoeffsBase : public EigenBase { typedef typename internal::packet_traits::type DefaultPacketType; eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); - return typename internal::evaluator::type(derived()).template packet(row,col); + return internal::evaluator(derived()).template packet(row,col); } @@ -245,7 +245,7 @@ class DenseCoeffsBase : public EigenBase { typedef typename internal::packet_traits::type DefaultPacketType; eigen_internal_assert(index >= 0 && index < size()); - return typename internal::evaluator::type(derived()).template packet(index); + return internal::evaluator(derived()).template packet(index); } protected: @@ -325,7 +325,7 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && row < rows() && col >= 0 && col < cols()); - return typename internal::evaluator::type(derived()).coeffRef(row,col); + return internal::evaluator(derived()).coeffRef(row,col); } EIGEN_DEVICE_FUNC @@ -371,7 +371,7 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && index < size()); - return typename internal::evaluator::type(derived()).coeffRef(index); + return internal::evaluator(derived()).coeffRef(index); } /** \returns a reference to the coefficient at given index. diff --git a/Eigen/src/Core/Inverse.h b/Eigen/src/Core/Inverse.h index 53d9b28f5..d70bffca9 100644 --- a/Eigen/src/Core/Inverse.h +++ b/Eigen/src/Core/Inverse.h @@ -100,13 +100,12 @@ namespace internal { */ template struct unary_evaluator > - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef Inverse InverseType; typedef typename InverseType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; enum { Flags = Base::Flags | EvalBeforeNestingBit }; diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index f58fa5f60..b79236f15 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -165,7 +165,7 @@ public: operator const Scalar() const { - return typename internal::evaluator::type(derived()).coeff(0,0); + return internal::evaluator(derived()).coeff(0,0); } }; @@ -203,7 +203,7 @@ class ProductImpl EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); - return typename internal::evaluator::type(derived()).coeff(row,col); + return internal::evaluator(derived()).coeff(row,col); } EIGEN_DEVICE_FUNC Scalar coeff(Index i) const @@ -211,7 +211,7 @@ class ProductImpl EIGEN_STATIC_ASSERT(EnableCoeff, THIS_METHOD_IS_ONLY_FOR_INNER_OR_LAZY_PRODUCTS); eigen_assert( (Option==LazyProduct) || (this->rows() == 1 && this->cols() == 1) ); - return typename internal::evaluator::type(derived()).coeff(i); + return internal::evaluator(derived()).coeff(i); } diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index f2c188631..2dcd02cbd 100755 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -32,7 +32,6 @@ struct evaluator > typedef Product XprType; typedef product_evaluator Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) : Base(xpr) {} @@ -47,7 +46,6 @@ struct evaluator, const Produ typedef CwiseUnaryOp, const Product > XprType; typedef evaluator,const Lhs>, Rhs, DefaultProduct> > Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) @@ -63,7 +61,6 @@ struct evaluator, DiagIndex> > typedef Diagonal, DiagIndex> XprType; typedef evaluator, DiagIndex> > Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) @@ -102,11 +99,11 @@ struct evaluator_traits > template struct product_evaluator, ProductTag, LhsShape, RhsShape, typename traits::Scalar, typename traits::Scalar, EnableIf<(Options==DefaultProduct || Options==AliasFreeProduct)> > - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef Product XprType; typedef typename XprType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; enum { Flags = Base::Flags | EvalBeforeNestingBit }; @@ -221,7 +218,7 @@ struct generic_product_impl template EIGEN_DONT_INLINE void outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const false_type&) { - typename evaluator::type rhsEval(rhs); + evaluator rhsEval(rhs); // FIXME make sure lhs is sequentially stored // FIXME not very good if rhs is real and lhs complex while alpha is real too // FIXME we should probably build an evaluator for dst @@ -234,7 +231,7 @@ EIGEN_DONT_INLINE void outer_product_selector_run(Dst& dst, const Lhs &lhs, cons template EIGEN_DONT_INLINE void outer_product_selector_run(Dst& dst, const Lhs &lhs, const Rhs &rhs, const Func& func, const true_type&) { - typename evaluator::type lhsEval(lhs); + evaluator lhsEval(lhs); // FIXME make sure rhs is sequentially stored // FIXME not very good if lhs is real and rhs complex while alpha is real too // FIXME we should probably build an evaluator for dst @@ -406,8 +403,8 @@ struct product_evaluator, ProductTag, DenseShape, typedef typename internal::remove_all::type LhsNestedCleaned; typedef typename internal::remove_all::type RhsNestedCleaned; - typedef typename evaluator::type LhsEtorType; - typedef typename evaluator::type RhsEtorType; + typedef evaluator LhsEtorType; + typedef evaluator RhsEtorType; enum { RowsAtCompileTime = LhsNestedCleaned::RowsAtCompileTime, diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h index af01a5567..5cd66ebed 100644 --- a/Eigen/src/Core/ReturnByValue.h +++ b/Eigen/src/Core/ReturnByValue.h @@ -94,13 +94,12 @@ namespace internal { template struct evaluator > - : public evaluator::ReturnType>::type + : public evaluator::ReturnType> { typedef ReturnByValue XprType; typedef typename internal::traits::ReturnType PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const XprType& xpr) diff --git a/Eigen/src/Core/Solve.h b/Eigen/src/Core/Solve.h index 47446b49e..911309018 100644 --- a/Eigen/src/Core/Solve.h +++ b/Eigen/src/Core/Solve.h @@ -113,13 +113,12 @@ namespace internal { // Evaluator of Solve -> eval into a temporary template struct evaluator > - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef Solve SolveType; typedef typename SolveType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; EIGEN_DEVICE_FUNC explicit evaluator(const SolveType& solve) diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 351630e57..63a1af8c1 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -664,7 +664,6 @@ struct unary_evaluator, IndexBased> { typedef TriangularView XprType; typedef evaluator::type> Base; - typedef evaluator type; unary_evaluator(const XprType &xpr) : Base(xpr.nestedExpression()) {} }; @@ -734,8 +733,8 @@ EIGEN_DEVICE_FUNC void call_triangular_assignment_loop(const DstXprType& dst, co { eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); - typedef typename evaluator::type DstEvaluatorType; - typedef typename evaluator::type SrcEvaluatorType; + typedef evaluator DstEvaluatorType; + typedef evaluator SrcEvaluatorType; DstEvaluatorType dstEvaluator(dst); SrcEvaluatorType srcEvaluator(src); diff --git a/Eigen/src/Geometry/Homogeneous.h b/Eigen/src/Geometry/Homogeneous.h index 9f86eeb3d..abb4c2fd3 100644 --- a/Eigen/src/Geometry/Homogeneous.h +++ b/Eigen/src/Geometry/Homogeneous.h @@ -312,13 +312,11 @@ template<> struct AssignmentKind { typedef Dense2De template struct unary_evaluator, IndexBased> - : evaluator::PlainObject >::type + : evaluator::PlainObject > { typedef Homogeneous XprType; typedef typename XprType::PlainObject PlainObject; - typedef typename evaluator::type Base; - - typedef evaluator type; + typedef evaluator Base; typedef evaluator nestedType; explicit unary_evaluator(const XprType& op) @@ -390,6 +388,8 @@ struct product_evaluator, ProductTag, Homogeneous typedef typename helper::Xpr RefactoredXpr; typedef evaluator Base; + typedef evaluator nestedType; + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) : Base( xpr.lhs().nestedExpression() .lazyProduct( xpr.rhs().template topRows(xpr.lhs().nestedExpression().cols()) ) + ConstantBlock(xpr.rhs().row(xpr.rhs().rows()-1),xpr.lhs().rows(), 1) ) @@ -431,6 +431,8 @@ struct product_evaluator, ProductTag, DenseShape, typedef typename helper::Xpr RefactoredXpr; typedef evaluator Base; + typedef evaluator nestedType; + EIGEN_DEVICE_FUNC explicit product_evaluator(const XprType& xpr) : Base( xpr.lhs().template leftCols(xpr.rhs().nestedExpression().rows()) .lazyProduct( xpr.rhs().nestedExpression() ) + ConstantBlock(xpr.lhs().col(xpr.lhs().cols()-1),1,xpr.rhs().cols()) ) diff --git a/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h b/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h index ef7efc9cf..4450c9eed 100644 --- a/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +++ b/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h @@ -71,13 +71,12 @@ namespace internal { // Evaluator of SolveWithGuess -> eval into a temporary template struct evaluator > - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef SolveWithGuess SolveType; typedef typename SolveType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; evaluator(const SolveType& solve) diff --git a/Eigen/src/LU/InverseImpl.h b/Eigen/src/LU/InverseImpl.h index e5f270d19..e202a55cb 100644 --- a/Eigen/src/LU/InverseImpl.h +++ b/Eigen/src/LU/InverseImpl.h @@ -43,7 +43,7 @@ struct compute_inverse static inline void run(const MatrixType& matrix, ResultType& result) { typedef typename MatrixType::Scalar Scalar; - typename internal::evaluator::type matrixEval(matrix); + internal::evaluator matrixEval(matrix); result.coeffRef(0,0) = Scalar(1) / matrixEval.coeff(0,0); } }; diff --git a/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h b/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h index d25a161f7..6e664515d 100644 --- a/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +++ b/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h @@ -30,8 +30,8 @@ static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& r std::memset(mask,0,sizeof(bool)*rows); - typename evaluator::type lhsEval(lhs); - typename evaluator::type rhsEval(rhs); + evaluator lhsEval(lhs); + evaluator rhsEval(rhs); // estimate the number of non zero entries // given a rhs column containing Y non zeros, we assume that the respective Y columns diff --git a/Eigen/src/SparseCore/SparseAssign.h b/Eigen/src/SparseCore/SparseAssign.h index 9e8a31a45..e984bbdb3 100644 --- a/Eigen/src/SparseCore/SparseAssign.h +++ b/Eigen/src/SparseCore/SparseAssign.h @@ -70,8 +70,8 @@ template void assign_sparse_to_sparse(DstXprType &dst, const SrcXprType &src) { typedef typename DstXprType::Scalar Scalar; - typedef typename internal::evaluator::type DstEvaluatorType; - typedef typename internal::evaluator::type SrcEvaluatorType; + typedef internal::evaluator DstEvaluatorType; + typedef internal::evaluator SrcEvaluatorType; SrcEvaluatorType srcEvaluator(src); @@ -140,8 +140,8 @@ struct Assignment { eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); - typename internal::evaluator::type srcEval(src); - typename internal::evaluator::type dstEval(dst); + internal::evaluator srcEval(src); + internal::evaluator dstEval(dst); const Index outerEvaluationSize = (internal::evaluator::Flags&RowMajorBit) ? src.rows() : src.cols(); for (Index j=0; j::InnerIterator i(srcEval,j); i; ++i) @@ -157,8 +157,8 @@ struct Assignment::type srcEval(src); - typename internal::evaluator::type dstEval(dst); + internal::evaluator srcEval(src); + internal::evaluator dstEval(dst); const Index outerEvaluationSize = (internal::evaluator::Flags&RowMajorBit) ? src.rows() : src.cols(); for (Index j=0; j::InnerIterator i(srcEval,j); i; ++i) diff --git a/Eigen/src/SparseCore/SparseBlock.h b/Eigen/src/SparseCore/SparseBlock.h index 333cc6655..552bfca48 100644 --- a/Eigen/src/SparseCore/SparseBlock.h +++ b/Eigen/src/SparseCore/SparseBlock.h @@ -39,7 +39,7 @@ public: Index nonZeros() const { - typedef typename internal::evaluator::type EvaluatorType; + typedef internal::evaluator EvaluatorType; EvaluatorType matEval(m_matrix); Index nnz = 0; Index end = m_outerStart + m_outerSize.value(); diff --git a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h index 78d16892d..a4cc24e30 100644 --- a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +++ b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h @@ -238,7 +238,7 @@ struct binary_evaluator, Lhs, Rhs>, IndexBase { protected: typedef scalar_product_op BinaryOp; - typedef typename evaluator::type LhsEvaluator; + typedef evaluator LhsEvaluator; typedef typename evaluator::InnerIterator RhsIterator; public: typedef CwiseBinaryOp XprType; @@ -307,7 +307,7 @@ struct binary_evaluator, Lhs, Rhs>, IteratorB protected: typedef scalar_product_op BinaryOp; typedef typename evaluator::InnerIterator LhsIterator; - typedef typename evaluator::type RhsEvaluator; + typedef evaluator RhsEvaluator; public: typedef CwiseBinaryOp XprType; @@ -341,7 +341,7 @@ public: protected: LhsIterator m_lhsIter; - const RhsEvaluator &m_rhsEval; + const evaluator &m_rhsEval; const BinaryOp& m_functor; const Index m_outer; }; diff --git a/Eigen/src/SparseCore/SparseDenseProduct.h b/Eigen/src/SparseCore/SparseDenseProduct.h index 3e752ecd9..1a167445a 100644 --- a/Eigen/src/SparseCore/SparseDenseProduct.h +++ b/Eigen/src/SparseCore/SparseDenseProduct.h @@ -30,7 +30,7 @@ struct sparse_time_dense_product_impl::type Rhs; typedef typename internal::remove_all::type Res; typedef typename evaluator::InnerIterator LhsInnerIterator; - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) { LhsEval lhsEval(lhs); @@ -89,7 +89,7 @@ struct sparse_time_dense_product_impl::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const AlphaType& alpha) { - typename evaluator::type lhsEval(lhs); + evaluator lhsEval(lhs); for(Index c=0; c::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) { - typename evaluator::type lhsEval(lhs); + evaluator lhsEval(lhs); for(Index j=0; j::InnerIterator LhsInnerIterator; static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) { - typename evaluator::type lhsEval(lhs); + evaluator lhsEval(lhs); for(Index j=0; j::StorageKind,Sparse>::value, Lhs1 const&, SparseView >::type LhsArg; - typedef typename evaluator::type LhsEval; - typedef typename evaluator::type RhsEval; + typedef evaluator LhsEval; + typedef evaluator RhsEval; typedef typename evaluator::InnerIterator LhsIterator; typedef typename ProdXprType::Scalar Scalar; diff --git a/Eigen/src/SparseCore/SparseDiagonalProduct.h b/Eigen/src/SparseCore/SparseDiagonalProduct.h index 13b2f07bd..4dec7d7cc 100644 --- a/Eigen/src/SparseCore/SparseDiagonalProduct.h +++ b/Eigen/src/SparseCore/SparseDiagonalProduct.h @@ -39,7 +39,6 @@ struct product_evaluator, ProductTag, Diagonal : public sparse_diagonal_product_evaluator { typedef Product XprType; - typedef evaluator type; typedef evaluator nestedType; enum { CoeffReadCost = Dynamic, Flags = Rhs::Flags&RowMajorBit, Alignment = 0 }; // FIXME CoeffReadCost & Flags @@ -52,7 +51,6 @@ struct product_evaluator, ProductTag, SparseSh : public sparse_diagonal_product_evaluator, Lhs::Flags&RowMajorBit?SDP_AsCwiseProduct:SDP_AsScalarProduct> { typedef Product XprType; - typedef evaluator type; typedef evaluator nestedType; enum { CoeffReadCost = Dynamic, Flags = Lhs::Flags&RowMajorBit, Alignment = 0 }; // FIXME CoeffReadCost & Flags @@ -126,7 +124,7 @@ struct sparse_diagonal_product_evaluator::type m_sparseXprEval; + evaluator m_sparseXprEval; DiagCoeffNested m_diagCoeffNested; }; diff --git a/Eigen/src/SparseCore/SparseDot.h b/Eigen/src/SparseCore/SparseDot.h index b10c8058f..38bc4aa9e 100644 --- a/Eigen/src/SparseCore/SparseDot.h +++ b/Eigen/src/SparseCore/SparseDot.h @@ -26,7 +26,7 @@ SparseMatrixBase::dot(const MatrixBase& other) const eigen_assert(size() == other.size()); eigen_assert(other.size()>0 && "you are using a non initialized vector"); - typename internal::evaluator::type thisEval(derived()); + internal::evaluator thisEval(derived()); typename internal::evaluator::InnerIterator i(thisEval, 0); Scalar res(0); while (i) @@ -50,10 +50,10 @@ SparseMatrixBase::dot(const SparseMatrixBase& other) cons eigen_assert(size() == other.size()); - typename internal::evaluator::type thisEval(derived()); + internal::evaluator thisEval(derived()); typename internal::evaluator::InnerIterator i(thisEval, 0); - typename internal::evaluator::type otherEval(other.derived()); + internal::evaluator otherEval(other.derived()); typename internal::evaluator::InnerIterator j(otherEval, 0); Scalar res(0); diff --git a/Eigen/src/SparseCore/SparsePermutation.h b/Eigen/src/SparseCore/SparsePermutation.h index 7b5eb4c22..d63607b6c 100644 --- a/Eigen/src/SparseCore/SparsePermutation.h +++ b/Eigen/src/SparseCore/SparsePermutation.h @@ -91,11 +91,11 @@ template struct product_promote_storage_type struct product_evaluator, ProductTag, PermutationShape, SparseShape, typename traits::Scalar, typename traits::Scalar> - : public evaluator::ReturnType>::type + : public evaluator::ReturnType> { typedef Product XprType; typedef typename permutation_matrix_product::ReturnType PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; explicit product_evaluator(const XprType& xpr) : m_result(xpr.rows(), xpr.cols()) @@ -110,11 +110,11 @@ protected: template struct product_evaluator, ProductTag, SparseShape, PermutationShape, typename traits::Scalar, typename traits::Scalar> - : public evaluator::ReturnType>::type + : public evaluator::ReturnType> { typedef Product XprType; typedef typename permutation_matrix_product::ReturnType PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; explicit product_evaluator(const XprType& xpr) : m_result(xpr.rows(), xpr.cols()) diff --git a/Eigen/src/SparseCore/SparseProduct.h b/Eigen/src/SparseCore/SparseProduct.h index c62386ed1..c2131fd9d 100644 --- a/Eigen/src/SparseCore/SparseProduct.h +++ b/Eigen/src/SparseCore/SparseProduct.h @@ -63,13 +63,12 @@ struct generic_product_impl struct evaluator > > - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef SparseView > XprType; typedef typename XprType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; - typedef evaluator type; typedef evaluator nestedType; explicit evaluator(const XprType& xpr) diff --git a/Eigen/src/SparseCore/SparseRedux.h b/Eigen/src/SparseCore/SparseRedux.h index 763f2296b..50ebb2e53 100644 --- a/Eigen/src/SparseCore/SparseRedux.h +++ b/Eigen/src/SparseCore/SparseRedux.h @@ -18,7 +18,7 @@ SparseMatrixBase::sum() const { eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); Scalar res(0); - typename internal::evaluator::type thisEval(derived()); + internal::evaluator thisEval(derived()); for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) res += iter.value(); diff --git a/Eigen/src/SparseCore/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h index dec96efb5..b0c2e472e 100644 --- a/Eigen/src/SparseCore/SparseSelfAdjointView.h +++ b/Eigen/src/SparseCore/SparseSelfAdjointView.h @@ -255,7 +255,7 @@ inline void sparse_selfadjoint_time_dense_product(const SparseLhsType& lhs, cons // TODO use alpha eigen_assert(alpha==AlphaType(1) && "alpha != 1 is not implemented yet, sorry"); - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; typedef typename evaluator::InnerIterator LhsIterator; typedef typename SparseLhsType::Scalar LhsScalar; @@ -337,11 +337,11 @@ struct generic_product_impl struct product_evaluator, ProductTag, SparseSelfAdjointShape, SparseShape, typename traits::Scalar, typename traits::Scalar> - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef Product XprType; typedef typename XprType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; product_evaluator(const XprType& xpr) : m_lhs(xpr.lhs()), m_result(xpr.rows(), xpr.cols()) @@ -357,11 +357,11 @@ protected: template struct product_evaluator, ProductTag, SparseShape, SparseSelfAdjointShape, typename traits::Scalar, typename traits::Scalar> - : public evaluator::PlainObject>::type + : public evaluator::PlainObject> { typedef Product XprType; typedef typename XprType::PlainObject PlainObject; - typedef typename evaluator::type Base; + typedef evaluator Base; product_evaluator(const XprType& xpr) : m_rhs(xpr.rhs()), m_result(xpr.rows(), xpr.cols()) diff --git a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h index 48050077e..20078f72c 100644 --- a/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ b/Eigen/src/SparseCore/SparseSparseProductWithPruning.h @@ -39,8 +39,8 @@ static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& r else res.resize(rows, cols); - typename evaluator::type lhsEval(lhs); - typename evaluator::type rhsEval(rhs); + evaluator lhsEval(lhs); + evaluator rhsEval(rhs); // estimate the number of non zero entries // given a rhs column containing Y non zeros, we assume that the respective Y columns diff --git a/Eigen/src/SparseCore/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h index 0e6c01531..9871e4b2b 100644 --- a/Eigen/src/SparseCore/SparseTriangularView.h +++ b/Eigen/src/SparseCore/SparseTriangularView.h @@ -269,7 +269,7 @@ public: }; protected: - typename evaluator::type m_argImpl; + evaluator m_argImpl; }; } // end namespace internal diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h index 13add55f7..68d3fe4fa 100644 --- a/Eigen/src/SparseCore/SparseVector.h +++ b/Eigen/src/SparseCore/SparseVector.h @@ -457,7 +457,7 @@ template< typename Dest, typename Src> struct sparse_vector_assign_selector { static void run(Dest& dst, const Src& src) { eigen_internal_assert(src.innerSize()==src.size()); - typedef typename internal::evaluator::type SrcEvaluatorType; + typedef internal::evaluator SrcEvaluatorType; SrcEvaluatorType srcEval(src); for(typename SrcEvaluatorType::InnerIterator it(srcEval, 0); it; ++it) dst.insert(it.index()) = it.value(); @@ -468,7 +468,7 @@ template< typename Dest, typename Src> struct sparse_vector_assign_selector { static void run(Dest& dst, const Src& src) { eigen_internal_assert(src.outerSize()==src.size()); - typedef typename internal::evaluator::type SrcEvaluatorType; + typedef internal::evaluator SrcEvaluatorType; SrcEvaluatorType srcEval(src); for(Index i=0; i struct sparse_solve_triangular_selector { typedef typename Rhs::Scalar Scalar; - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; typedef typename evaluator::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) { @@ -65,7 +65,7 @@ template struct sparse_solve_triangular_selector { typedef typename Rhs::Scalar Scalar; - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; typedef typename evaluator::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) { @@ -104,7 +104,7 @@ template struct sparse_solve_triangular_selector { typedef typename Rhs::Scalar Scalar; - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; typedef typename evaluator::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) { @@ -139,7 +139,7 @@ template struct sparse_solve_triangular_selector { typedef typename Rhs::Scalar Scalar; - typedef typename evaluator::type LhsEval; + typedef evaluator LhsEval; typedef typename evaluator::InnerIterator LhsIterator; static void run(const Lhs& lhs, Rhs& other) {