Simplify cost computations based on HugeCost being smaller that unrolling limit

This commit is contained in:
Gael Guennebaud
2015-10-28 13:39:02 +01:00
parent 1f11dd6ced
commit 8531304858
7 changed files with 11 additions and 26 deletions

View File

@@ -36,7 +36,7 @@ const int Infinity = -1;
* 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;
const int HugeCost = 10000;
/** \defgroup flags Flags
* \ingroup Core_Module

View File

@@ -204,6 +204,6 @@
// Check that a cost value is positive, and that is stay within a reasonable range
// TODO this check could be enabled for internal debugging only
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C) \
EIGEN_STATIC_ASSERT((C)>=0 && (C)<2*HugeCost*HugeCost, EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT__INVALID_COST_VALUE);
EIGEN_STATIC_ASSERT((C)>=0 && (C)<=HugeCost*HugeCost, EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT__INVALID_COST_VALUE);
#endif // EIGEN_STATIC_ASSERT_H