mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-06 13:15:14 +08:00
Fix hyperbolic functions for autodiff.
This commit is contained in:
parent
c50c73cae2
commit
cfff370549
@ -657,17 +657,17 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(acos,
|
|||||||
EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(tanh,
|
EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(tanh,
|
||||||
using std::cosh;
|
using std::cosh;
|
||||||
using std::tanh;
|
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,
|
EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(sinh,
|
||||||
using std::sinh;
|
using std::sinh;
|
||||||
using std::cosh;
|
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,
|
EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(cosh,
|
||||||
using std::sinh;
|
using std::sinh;
|
||||||
using std::cosh;
|
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
|
#undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user