This forum has been archived. All content is frozen. Please use KDE Discuss instead.

coefficient-wise atan2

Tags: None
(comma "," separated)
masahiko
Registered Member
Posts
2
Karma
0

coefficient-wise atan2

Wed Mar 07, 2012 7:02 am
I'm porting MATLAB code into C++, but I have a problem.

In the MATLAB source, there is a statement like this.

C=atan2(-A,B)

where A and B are matrices.

How can I write this in C++ using Eigen?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: coefficient-wise atan2

Wed Mar 07, 2012 9:32 pm
indeed, we don't offer an atan2 method yet. You can still do:

using std::atan2;

-A.binaryExpr(B, std::ptr_fun(atan2))
masahiko
Registered Member
Posts
2
Karma
0

Re: coefficient-wise atan2

Thu Mar 08, 2012 2:25 am
Oh... Thanks.
I didn't notice binaryExpr function.
It worked.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]