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

Missing .arg() for complex arrays?

Tags: None
(comma "," separated)
twood
Registered Member
Posts
17
Karma
0

Missing .arg() for complex arrays?

Tue Jun 17, 2014 2:02 pm
Hello,
I have begun using arrays of complex numbers in Eigen (i.e. ArrayXcd). I see .real(), .imag() and .abs() methods, but I can't see a corresponding .arg() method to get the element-wise complex argument/phase/angle. I have fallen back to using (on a complex array called data):
Code: Select all
data.imag().binaryExpr(data.real(), ptr_fun<double,double,double>(atan2))
But this is rather clumsy. Am I missing an obvious better way or is this functionality missing from Eigen at the moment?
Thanks in advance.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Right, we should add both atan2 and arg shortcuts.
jitseniesen
Registered Member
Posts
204
Karma
2
I updated bug 80 on bugzilla with these functions; see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=80


Bookmarks



Who is online

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