diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-10-28 11:42:14 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-10-28 11:42:14 +0100 |
commit | 77ff3386b7d28c68c9e277e60f285ae1b3124b47 (patch) | |
tree | a9e5cefe36dd832d1d1d7e0dbdcedf1c8c1b5b56 /Eigen/src/Core/Visitor.h | |
parent | 827d8a9bad6f6c8a8e0211358b51c60db18a2cfb (diff) |
Refactoring of the cost model:
- Dynamic is now an invalid value
- introduce a HugeCost constant to be used for runtime-cost values or arbitrarily huge cost
- add sanity checks for cost values: must be >=0 and not too large
This change provides several benefits:
- it fixes shortcoming is some cost computation where the Dynamic case was not properly handled.
- it simplifies cost computation logic, and should avoid future similar shortcomings.
- it allows to distinguish between different level of dynamic/huge/infinite cost
- it should enable further simplifications in the computation of costs (save compilation time)
Diffstat (limited to 'Eigen/src/Core/Visitor.h')
-rw-r--r-- | Eigen/src/Core/Visitor.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index a4e2cebab..f3f15e9e0 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -110,8 +110,8 @@ void DenseBase<Derived>::visit(Visitor& visitor) const ThisEvaluator thisEval(derived()); enum { unroll = SizeAtCompileTime != Dynamic - && ThisEvaluator::CoeffReadCost != Dynamic - && (SizeAtCompileTime == 1 || internal::functor_traits<Visitor>::Cost != Dynamic) + && ThisEvaluator::CoeffReadCost < HugeCost + && (SizeAtCompileTime == 1 || internal::functor_traits<Visitor>::Cost < HugeCost) && SizeAtCompileTime * ThisEvaluator::CoeffReadCost + (SizeAtCompileTime-1) * internal::functor_traits<Visitor>::Cost <= EIGEN_UNROLLING_LIMIT }; return internal::visitor_impl<Visitor, ThisEvaluator, |