From e735692e3709d7b42e1c1c7dfb1055081b49b0dc Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Jun 2008 07:10:50 +0000 Subject: [PATCH] move "enum" back to "const int" int ei_assign_impl: in fact, casting enums to int is enough to get compile time constants with ICC. --- Eigen/src/Core/Assign.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index b0e885dfe..d5604824f 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -351,25 +351,22 @@ struct ei_assign_impl::size, - alignedSize = (int(size)/int(packetSize))*int(packetSize), - rowMajor = int(Derived1::Flags)&RowMajorBit, - innerSize = int(rowMajor) ? int(Derived1::ColsAtCompileTime) : int(Derived1::RowsAtCompileTime), - outerSize = int(rowMajor) ? int(Derived1::RowsAtCompileTime) : int(Derived1::ColsAtCompileTime) - }; + const int size = Derived1::SizeAtCompileTime; + const int packetSize = ei_packet_traits::size; + const int alignedSize = (size/packetSize)*packetSize; + const bool rowMajor = int(Derived1::Flags)&RowMajorBit; + const int innerSize = rowMajor ? int(Derived1::ColsAtCompileTime) : int(Derived1::RowsAtCompileTime); + const int outerSize = rowMajor ? int(Derived1::RowsAtCompileTime) : int(Derived1::ColsAtCompileTime); // do the vectorizable part of the assignment ei_assign_innervec_CompleteUnrolling::run(dst, src); // now we must do the rest without vectorization. - enum { - k = int(alignedSize)/int(innerSize), - i = int(alignedSize)%int(innerSize) - }; + const int k = alignedSize/innerSize; + const int i = alignedSize%innerSize; + // do the remainder of the current row or col - ei_assign_novec_InnerUnrolling::run(dst, src, k); + ei_assign_novec_InnerUnrolling::run(dst, src, k); // do the remaining rows or cols for(int j = k+1; j < outerSize; j++)