From f9598d73b56430f34379945c45b80bdc65dc3d61 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 25 Jul 2016 14:42:19 +0200 Subject: [PATCH] bug #1250: fix pow() for AutoDiffScalar with custom nested scalar type. --- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h index 76bf2d96c..a4d12ab37 100755 --- a/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +++ b/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h @@ -617,7 +617,8 @@ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(typename internal::remove_all::t pow(const Eigen::AutoDiffScalar &x, const typename internal::traits::type>::Scalar &y) { using namespace Eigen; - return Eigen::MakeAutoDiffScalar(std::pow(x.value(),y), x.derivatives() * (y * std::pow(x.value(),y-1))); + using std::pow; + return Eigen::MakeAutoDiffScalar(pow(x.value(),y), x.derivatives() * (y * pow(x.value(),y-1))); }