Fix hyperbolic functions for autodiff.

This commit is contained in:
Gael Guennebaud 2016-06-24 23:21:35 +02:00
parent c50c73cae2
commit cfff370549

View File

@ -657,17 +657,17 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(acos,
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()))));)
return Eigen::MakeAutoDiffScalar(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()));)
return Eigen::MakeAutoDiffScalar(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()));)
return Eigen::MakeAutoDiffScalar(cosh(x.value()),x.derivatives() * sinh(x.value()));)
#undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY