New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1250 - AutoDiffScalar.h std::pow(x,y)
Summary: AutoDiffScalar.h std::pow(x,y)
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Unsupported modules (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-05 12:41 UTC by 4321rd1234
Modified: 2016-07-25 12:40 UTC (History)
2 users (show)



Attachments

Description 4321rd1234 2016-07-05 12:41:38 UTC
Hello, 

I would propose the following change in AutoDiffScalar.h (head) 

620c620,621
<   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)));


The current implementation, i.e. see first line, gives a compile error 
if mpreal from  unsupported/MPFRC++ Support module is used as a Scalar.
The proposed change follows the idea of the rest of AutoDiffScalar.h

Bye 

Ralf
Comment 1 Gael Guennebaud 2016-07-25 12:40:32 UTC
Thanks for the fix.
https://bitbucket.org/eigen/eigen/commits/8267656b597c/

Note You need to log in before you can comment on or make changes to this bug.