aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Array/BooleanRedux.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Array/BooleanRedux.h')
-rw-r--r--Eigen/src/Array/BooleanRedux.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/Eigen/src/Array/BooleanRedux.h b/Eigen/src/Array/BooleanRedux.h
index 67c29f546..b9de54029 100644
--- a/Eigen/src/Array/BooleanRedux.h
+++ b/Eigen/src/Array/BooleanRedux.h
@@ -89,8 +89,10 @@ struct ei_any_unroller<Derived, Dynamic>
template<typename Derived>
inline bool DenseBase<Derived>::all() const
{
- const bool unroll = SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost)
- <= EIGEN_UNROLLING_LIMIT;
+ const bool unroll = SizeAtCompileTime != Dynamic
+ && CoeffReadCost != Dynamic
+ && NumTraits<Scalar>::AddCost != Dynamic
+ && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT;
if(unroll)
return ei_all_unroller<Derived,
unroll ? int(SizeAtCompileTime) : Dynamic
@@ -113,8 +115,10 @@ inline bool DenseBase<Derived>::all() const
template<typename Derived>
inline bool DenseBase<Derived>::any() const
{
- const bool unroll = SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost)
- <= EIGEN_UNROLLING_LIMIT;
+ const bool unroll = SizeAtCompileTime != Dynamic
+ && CoeffReadCost != Dynamic
+ && NumTraits<Scalar>::AddCost != Dynamic
+ && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT;
if(unroll)
return ei_any_unroller<Derived,
unroll ? int(SizeAtCompileTime) : Dynamic