mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add autodiff coverage for standard library hyperbolic functions, and tests.
* * * Corrected tanh derivatived, moved test definitions. * * * Added more test cases, removed lingering lines
This commit is contained in:
@@ -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> >
|
||||
|
||||
Reference in New Issue
Block a user