aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-06-20 07:10:50 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-06-20 07:10:50 +0000
commite735692e3709d7b42e1c1c7dfb1055081b49b0dc (patch)
tree5724985e989219529a06c5a50b4742536b25728e /Eigen/src/Core
parentfb4a1519829eabef0699b297fa493c2c495631e5 (diff)
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.
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r--Eigen/src/Core/Assign.h23
1 files 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<Derived1, Derived2, LinearVectorization, CompleteUnrolling
{
inline static void run(Derived1 &dst, const Derived2 &src)
{
- enum {
- size = Derived1::SizeAtCompileTime,
- packetSize = ei_packet_traits<typename Derived1::Scalar>::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<typename Derived1::Scalar>::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<Derived1, Derived2, 0, alignedSize>::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<Derived1, Derived2, i, int(k)<int(outerSize) ? int(innerSize) : 0>::run(dst, src, k);
+ ei_assign_novec_InnerUnrolling<Derived1, Derived2, i, k<outerSize ? innerSize : 0>::run(dst, src, k);
// do the remaining rows or cols
for(int j = k+1; j < outerSize; j++)