diff options
author | Geoffrey Lalonde <lalondegeoffrey@gmail.com> | 2016-06-15 23:33:19 -0700 |
---|---|---|
committer | Geoffrey Lalonde <lalondegeoffrey@gmail.com> | 2016-06-15 23:33:19 -0700 |
commit | 72c95383e03ea86d6a154faa7ec684d7f4d1e750 (patch) | |
tree | cbd943554a09ec50c34e496ec1241f0ffe16b540 /unsupported/Eigen/src/AutoDiff | |
parent | d7e3e4bb0407718d27cb62c6409dfaf0ea0986d1 (diff) |
Add autodiff coverage for standard library hyperbolic functions, and tests.
* * *
Corrected tanh derivatived, moved test definitions.
* * *
Added more test cases, removed lingering lines
Diffstat (limited to 'unsupported/Eigen/src/AutoDiff')
-rwxr-xr-x | unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 089042751..1c60e96a7 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -646,6 +646,21 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(acos, using std::acos; return ReturnType(acos(x.value()),x.derivatives() * (Scalar(-1)/sqrt(1-numext::abs2(x.value()))));) +EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(tanh, + using std::cosh; + using std::tanh; + return ReturnType(tanh(x.value()),x.derivatives() * (Scalar(1)/numext::abs2(cosh(x.value()))));) + +EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(sinh, + using std::sinh; + using std::cosh; + return ReturnType(sinh(x.value()),x.derivatives() * cosh(x.value()));) + +EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(cosh, + using std::sinh; + using std::cosh; + return ReturnType(cosh(x.value()),x.derivatives() * sinh(x.value()));) + #undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY template<typename DerType> struct NumTraits<AutoDiffScalar<DerType> > |