diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-20 12:19:15 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-20 12:19:15 -0400 |
commit | 72b002eab91cf058dfc667911db5e06cc1448a39 (patch) | |
tree | 9bdf9b02334665962d5ee64dfa0a6af7bdd67f5b | |
parent | c7ae261ac08453e040caafb9383320c9ff95c48f (diff) |
work around internal compiler error with gcc 4.1 and 4.2, reported on the forum
-rw-r--r-- | Eigen/src/Core/Product.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index e1e106b80..d70344deb 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -61,11 +61,22 @@ template<typename Lhs, typename Rhs> struct ei_product_type enum { Rows = Lhs::RowsAtCompileTime, Cols = Rhs::ColsAtCompileTime, - Depth = EIGEN_ENUM_MIN(Lhs::ColsAtCompileTime,Rhs::RowsAtCompileTime), - - value = ei_product_type_selector<(Rows >=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Rows==1 ? 1 : Small)), - (Cols >=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Cols==1 ? 1 : Small)), - (Depth>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Depth==1 ? 1 : Small))>::ret + Depth = EIGEN_ENUM_MIN(Lhs::ColsAtCompileTime,Rhs::RowsAtCompileTime) + }; + + // the splitting into different lines of code here, introducing the _select enums and the typedef below, + // is to work around an internal compiler error with gcc 4.1 and 4.2. +private: + enum { + rows_select = Rows >=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Rows==1 ? 1 : Small), + cols_select = Cols >=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Cols==1 ? 1 : Small), + depth_select = Depth>=EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD ? Large : (Depth==1 ? 1 : Small) + }; + typedef ei_product_type_selector<rows_select, cols_select, depth_select> product_type_selector; + +public: + enum { + value = product_type_selector::ret }; }; |