This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
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: 2019-12-04 15:58 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/
Comment 2 Nobody 2019-12-04 15:58:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1250.

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