From e8cdbedefb1913b5a0e2f2b7d38470f081cb8d29 Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Thu, 4 Dec 2014 22:48:53 +0100 Subject: bug #877, bug #572: Introduce a global Index typedef. Rename Sparse*::Index to StorageIndex, make Dense*::StorageIndex an alias to DenseIndex. Overall this commit gets rid of all Index conversion warnings. --- Eigen/src/Core/AssignEvaluator.h | 52 +++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 30 deletions(-) (limited to 'Eigen/src/Core/AssignEvaluator.h') diff --git a/Eigen/src/Core/AssignEvaluator.h b/Eigen/src/Core/AssignEvaluator.h index 4db10e697..506bace69 100644 --- a/Eigen/src/Core/AssignEvaluator.h +++ b/Eigen/src/Core/AssignEvaluator.h @@ -179,20 +179,20 @@ struct copy_using_evaluator_DefaultTraversal_CompleteUnrolling +template struct copy_using_evaluator_DefaultTraversal_InnerUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, typename Kernel::Index outer) + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) { - kernel.assignCoeffByOuterInner(outer, Index); - copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); + kernel.assignCoeffByOuterInner(outer, Index_); + copy_using_evaluator_DefaultTraversal_InnerUnrolling::run(kernel, outer); } }; template struct copy_using_evaluator_DefaultTraversal_InnerUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, typename Kernel::Index) { } + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index) { } }; /*********************** @@ -246,13 +246,13 @@ struct copy_using_evaluator_innervec_CompleteUnrolling EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&) { } }; -template +template struct copy_using_evaluator_innervec_InnerUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, typename Kernel::Index outer) + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, Index outer) { - kernel.template assignPacketByOuterInner(outer, Index); - enum { NextIndex = Index + packet_traits::size }; + kernel.template assignPacketByOuterInner(outer, Index_); + enum { NextIndex = Index_ + packet_traits::size }; copy_using_evaluator_innervec_InnerUnrolling::run(kernel, outer); } }; @@ -260,7 +260,7 @@ struct copy_using_evaluator_innervec_InnerUnrolling template struct copy_using_evaluator_innervec_InnerUnrolling { - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &, typename Kernel::Index) { } + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &, Index) { } }; /*************************************************************************** @@ -283,8 +283,6 @@ struct dense_assignment_loop { EIGEN_DEVICE_FUNC static void run(Kernel &kernel) { - typedef typename Kernel::Index Index; - for(Index outer = 0; outer < kernel.outerSize(); ++outer) { for(Index inner = 0; inner < kernel.innerSize(); ++inner) { kernel.assignCoeffByOuterInner(outer, inner); @@ -306,7 +304,7 @@ struct dense_assignment_loop template struct dense_assignment_loop { - typedef typename Kernel::Index Index; + typedef typename Kernel::StorageIndex StorageIndex; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) { typedef typename Kernel::DstEvaluatorType::XprType DstXprType; @@ -330,7 +328,7 @@ struct unaligned_dense_assignment_loop { // if IsAligned = true, then do nothing template - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, typename Kernel::Index, typename Kernel::Index) {} + EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel&, Index, Index) {} }; template <> @@ -342,16 +340,16 @@ struct unaligned_dense_assignment_loop #if EIGEN_COMP_MSVC template static EIGEN_DONT_INLINE void run(Kernel &kernel, - typename Kernel::Index start, - typename Kernel::Index end) + Index start, + Index end) #else template EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel, - typename Kernel::Index start, - typename Kernel::Index end) + Index start, + Index end) #endif { - for (typename Kernel::Index index = start; index < end; ++index) + for (Index index = start; index < end; ++index) kernel.assignCoeff(index); } }; @@ -361,8 +359,6 @@ struct dense_assignment_loop { EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) { - typedef typename Kernel::Index Index; - const Index size = kernel.size(); typedef packet_traits PacketTraits; enum { @@ -386,7 +382,7 @@ struct dense_assignment_loop template struct dense_assignment_loop { - typedef typename Kernel::Index Index; + typedef typename Kernel::StorageIndex StorageIndex; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) { typedef typename Kernel::DstEvaluatorType::XprType DstXprType; @@ -409,8 +405,6 @@ struct dense_assignment_loop { EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel) { - typedef typename Kernel::Index Index; - const Index innerSize = kernel.innerSize(); const Index outerSize = kernel.outerSize(); const Index packetSize = packet_traits::size; @@ -433,7 +427,7 @@ struct dense_assignment_loop struct dense_assignment_loop { - typedef typename Kernel::Index Index; + typedef typename Kernel::StorageIndex StorageIndex; EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel) { typedef typename Kernel::DstEvaluatorType::XprType DstXprType; @@ -452,7 +446,6 @@ struct dense_assignment_loop { EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel) { - typedef typename Kernel::Index Index; const Index size = kernel.size(); for(Index i = 0; i < size; ++i) kernel.assignCoeff(i); @@ -478,7 +471,6 @@ struct dense_assignment_loop { EIGEN_DEVICE_FUNC static inline void run(Kernel &kernel) { - typedef typename Kernel::Index Index; typedef packet_traits PacketTraits; enum { packetSize = PacketTraits::size, @@ -533,7 +525,7 @@ public: typedef DstEvaluatorTypeT DstEvaluatorType; typedef SrcEvaluatorTypeT SrcEvaluatorType; typedef typename DstEvaluatorType::Scalar Scalar; - typedef typename DstEvaluatorType::Index Index; + typedef typename DstEvaluatorType::StorageIndex StorageIndex; typedef copy_using_evaluator_traits AssignmentTraits; @@ -731,8 +723,8 @@ EIGEN_DEVICE_FUNC void call_assignment_no_alias(Dst& dst, const Src& src, const && int(Dst::SizeAtCompileTime) != 1 }; - typename Dst::Index dstRows = NeedToTranspose ? src.cols() : src.rows(); - typename Dst::Index dstCols = NeedToTranspose ? src.rows() : src.cols(); + Index dstRows = NeedToTranspose ? src.cols() : src.rows(); + Index dstCols = NeedToTranspose ? src.rows() : src.cols(); if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) dst.resize(dstRows, dstCols); -- cgit v1.2.3