Bug 561 - AutoDiffScalar.h add #undef sign ?
AutoDiffScalar.h add #undef sign ?
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Unsupported modules
3.2
All All
: Normal Unknown
Assigned To: Gael Guennebaud
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-07 17:22 UTC by Ralf Denzer
Modified: 2013-03-07 23:37 UTC (History)
2 users (show)



Attachments

Description Ralf Denzer 2013-03-07 17:22:33 UTC
Hello, 

I propose to insert in the file 

eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h

a line 

#undef sign

after #define sign(x) is not anymore needed. This #define sign(x)
may conflict with a user definition of a sign(x) as it did in my
case.

Maybe line 618 (after #undef EIGEN_AUTODIFF_DECLARE_GLOBAL_UNARY)
would be a good place?

Bye

Ralf
Comment 1 Christoph Hertzberg 2013-03-07 18:01:47 UTC
(In reply to comment #0)
> eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h

I actually don't see why this requires a #define at all. Either an inline function could be used or, as it is used only once, it could be expanded directly.
If for some technical reasons there must be a define then call it something like EIGEN_AUTODIFF_SIGN.
Comment 2 Gael Guennebaud 2013-03-07 23:37:28 UTC
I've no clue how this stupid macro got there.

https://bitbucket.org/eigen/eigen/commits/dca9a6c05154/
changeset:   dca9a6c05154
user:        ggael
date:        2013-03-07 23:35:26
summary:     Fix bug 561: remove useless sign macro

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