diff options
author | 2010-04-28 18:51:38 -0400 | |
---|---|---|
committer | 2010-04-28 18:51:38 -0400 | |
commit | e2775869588e1df2d19265eac5c167651168a414 (patch) | |
tree | 8ca0d2fdbc1f8945405fb3fd99c5634b60f3189f /unsupported/Eigen/src/AutoDiff | |
parent | 4f83d6ad1959f3c76cd5eb328ec65ced4ca4f339 (diff) |
Complete rework of global math functions and NumTraits.
* Now completely generic so all standard integer types (like char...) are supported.
** add unit test for that (integer_types).
* NumTraits does no longer inherit numeric_limits
* All math functions are now templated
* Better guard (static asserts) against using certain math functions on integer types.
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rw-r--r-- | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 4b7331035..35db65ff0 100644 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -552,19 +552,10 @@ ei_pow(const AutoDiffScalar<DerType>& x, typename ei_traits<DerType>::Scalar y) #undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY template<typename DerType> struct NumTraits<AutoDiffScalar<DerType> > + : NumTraits< typename NumTraits<typename DerType::Scalar>::Real > { - typedef typename NumTraits<typename DerType::Scalar>::Real Real; - typedef AutoDiffScalar<DerType> FloatingPoint; + typedef AutoDiffScalar<DerType> NonInteger; typedef AutoDiffScalar<DerType>& Nested; - enum { - IsComplex = 0, - HasFloatingPoint = 1, - ReadCost = 1, - AddCost = 1, - MulCost = 1 - }; - inline static Real epsilon() { return std::numeric_limits<Real>::epsilon(); } - inline static Real dummy_precision() { return NumTraits<Real>::dummy_precision(); } }; } |