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)
{
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++)