diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-03-07 23:35:26 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-03-07 23:35:26 +0100 |
commit | 03373f41cb36b3419d6cbdcc72a3401c8ee28480 (patch) | |
tree | 60bd17df98c1c083f92dfaecf0a8b128e429233d /unsupported/Eigen/src/AutoDiff | |
parent | f82ee241acedf98752528fefcfd8fa8dc4009875 (diff) |
Fix bug #561: remove useless sign macro
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rw-r--r-- | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index b833df3c0..2be920532 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -532,11 +532,9 @@ inline AutoDiffScalar<DerType> (min)(const T& x, const AutoDiffScalar<DerType>& template<typename DerType, typename T> inline AutoDiffScalar<DerType> (max)(const T& x, const AutoDiffScalar<DerType>& y) { return (x > y ? x : y); } -#define sign(x) x >= 0 ? 1 : -1 // required for abs function below - EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(abs, using std::abs; - return ReturnType(abs(x.value()), x.derivatives() * (sign(x.value())));) + return ReturnType(abs(x.value()), x.derivatives() * (x.value()<0 ? -1 : 1) );) EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(abs2, using internal::abs2; |