![]() Registered Member ![]()
|
I have needed this in the context of GoogleTest tests so I implemented it like a macro:
but I also need something that simply returns true if two VectorXd are close element-wise to an epsilon. This would be a quick and dirty implementation:
How can I do that in the most succint way? |
![]() Moderator ![]()
|
What about A.isApprox(B), though the comparison is not done the exact same way. See http://eigen.tuxfamily.org/dox/classEig ... 98db8e8966.
Your definition is equivalent to:
but that's assuming that the expected magnitudes of A and B elements are always the same. |
![]() Registered Member ![]()
|
As usual
![]() |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]