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

equality test operators?

Tags: None
(comma "," separated)
eudoxos
Registered Member
Posts
36
Karma
0

equality test operators?

Tue May 04, 2010 11:06 am
Hi,

there are no operator== and operator!= defined for Quaternion (and for Matrix, for that matter). Is that intentional?

I know that float comparisons don't always makes sense, but are occasionally useful for testing exact equality of small arrays (say, 3 elements).

I defined those operators by hand externally, that works, but I am wondering if there is a more straightforward way in Eigen.

Cheers, Vaclav
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: equality test operators?

Tue May 04, 2010 11:09 am
We just didn't expect anybody to use that, but why not. Anyway, this is just an API addition so it can be made at any later date.


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
eudoxos
Registered Member
Posts
36
Karma
0

Re: equality test operators?

Tue May 04, 2010 11:12 am
Speaking of API additions, in Wm3, the normalize method returned the norm before normalization (which has to be computed internally anyway) rather than void, as it is in Eigen. It made the code more elegant (though perhaps less readable) at some places.
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: equality test operators?

Tue May 04, 2010 11:14 am
hm no sorry, i'm not in favor of this kind of API that is not self-explanatory. I realize the interest of getting the norm, but then i prefer to let people do themselves: float norm = quaternion.norm(); quaternion/=norm;


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
eudoxos
Registered Member
Posts
36
Karma
0

Re: equality test operators?

Tue May 04, 2010 11:16 am
No problem, I changed the code everywhere already anyways. BTW soon you might add https://www.yade-dem.org to projects using Eigen :-)
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: equality test operators?

Tue May 04, 2010 11:17 am
Very exciting! When you want to, just edit the wiki yourself :)


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]