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.
This commit is contained in:
Gael Guennebaud 2008-06-20 07:10:50 +00:00
parent fb4a151982
commit e735692e37

View File

@ -351,25 +351,22 @@ struct ei_assign_impl<Derived1, Derived2, LinearVectorization, CompleteUnrolling
{ {
inline static void run(Derived1 &dst, const Derived2 &src) inline static void run(Derived1 &dst, const Derived2 &src)
{ {
enum { const int size = Derived1::SizeAtCompileTime;
size = Derived1::SizeAtCompileTime, const int packetSize = ei_packet_traits<typename Derived1::Scalar>::size;
packetSize = ei_packet_traits<typename Derived1::Scalar>::size, const int alignedSize = (size/packetSize)*packetSize;
alignedSize = (int(size)/int(packetSize))*int(packetSize), const bool rowMajor = int(Derived1::Flags)&RowMajorBit;
rowMajor = int(Derived1::Flags)&RowMajorBit, const int innerSize = rowMajor ? int(Derived1::ColsAtCompileTime) : int(Derived1::RowsAtCompileTime);
innerSize = int(rowMajor) ? int(Derived1::ColsAtCompileTime) : int(Derived1::RowsAtCompileTime), const int outerSize = rowMajor ? int(Derived1::RowsAtCompileTime) : int(Derived1::ColsAtCompileTime);
outerSize = int(rowMajor) ? int(Derived1::RowsAtCompileTime) : int(Derived1::ColsAtCompileTime)
};
// do the vectorizable part of the assignment // do the vectorizable part of the assignment
ei_assign_innervec_CompleteUnrolling<Derived1, Derived2, 0, alignedSize>::run(dst, src); ei_assign_innervec_CompleteUnrolling<Derived1, Derived2, 0, alignedSize>::run(dst, src);
// now we must do the rest without vectorization. // now we must do the rest without vectorization.
enum { const int k = alignedSize/innerSize;
k = int(alignedSize)/int(innerSize), const int i = alignedSize%innerSize;
i = int(alignedSize)%int(innerSize)
};
// do the remainder of the current row or col // 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 // do the remaining rows or cols
for(int j = k+1; j < outerSize; j++) for(int j = k+1; j < outerSize; j++)