From 4d7e230d2f8a55c45c1191fe08aa19d41e869a65 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 5 Apr 2016 14:49:41 +0200 Subject: bug #1189: fix pow/atan2 compilation for AutoDiffScalar --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'unsupported/Eigen/src') diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index e30ad5b6d..481dfa91a 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -589,23 +589,24 @@ EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY(log, return ReturnType(log(x.value()),x.derivatives() * (Scalar(1)/x.value()));) template -inline const Eigen::AutoDiffScalar::Scalar>, const DerType> > -pow(const Eigen::AutoDiffScalar& x, typename Eigen::internal::traits::Scalar y) +inline const Eigen::AutoDiffScalar::type>::Scalar>, const typename internal::remove_all::type> > +pow(const Eigen::AutoDiffScalar& x, typename internal::traits::type>::Scalar y) { using namespace Eigen; - typedef typename Eigen::internal::traits::Scalar Scalar; - return AutoDiffScalar, const DerType> >( + typedef typename internal::remove_all::type DerTypeCleaned; + typedef typename Eigen::internal::traits::Scalar Scalar; + return AutoDiffScalar, const DerTypeCleaned> >( std::pow(x.value(),y), x.derivatives() * (y * std::pow(x.value(),y-1))); } template -inline const AutoDiffScalar::Scalar,Dynamic,1> > +inline const AutoDiffScalar::type>::Scalar,Dynamic,1> > atan2(const AutoDiffScalar& a, const AutoDiffScalar& b) { using std::atan2; - typedef typename internal::traits::Scalar Scalar; + typedef typename internal::traits::type>::Scalar Scalar; typedef AutoDiffScalar > PlainADS; PlainADS ret; ret.value() = atan2(a.value(), b.value()); -- cgit v1.2.3