diff options
author | 2015-10-28 11:42:14 +0100 | |
---|---|---|
committer | 2015-10-28 11:42:14 +0100 | |
commit | 77ff3386b7d28c68c9e277e60f285ae1b3124b47 (patch) | |
tree | a9e5cefe36dd832d1d1d7e0dbdcedf1c8c1b5b56 /Eigen/src/Core/util/Constants.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/util/Constants.h')
-rw-r--r-- | Eigen/src/Core/util/Constants.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h index ddb1cf6f4..12238e5dd 100644 --- a/Eigen/src/Core/util/Constants.h +++ b/Eigen/src/Core/util/Constants.h @@ -30,6 +30,14 @@ const int DynamicIndex = 0xffffff; */ const int Infinity = -1; +/** This value means that the cost to evaluate an expression coefficient is either very expensive or + * cannot be known at compile time. + * + * This value has to be positive to (1) simplify cost computation, and (2) allow to distinguish between a very expensive and very very expensive expressions. + * It thus must also be large enough to make sure unrolling won't happen and that sub expressions will be evaluated, but not too large to avoid overflow. + */ +const int HugeCost = 1000; + /** \defgroup flags Flags * \ingroup Core_Module * |