I was wondering if there is a good way to test two Eigen matrices for approximate equality using Google Test, or Google Mock.
Take the following test-case as a
Why not use the isApprox
or isMuchSmallerThan
member functions of Eigen Matrix types?
The documentation of these above functions are available here
So for most cases ASSERT_TRUE(C_actual.isApprox(C_expect));
is what you need. You can also provide a precision parameter as the second arguement to isApprox.