| 30 | |
| 31 | template <typename T, typename U> |
| 32 | void check_equal ( |
| 33 | const T& a, |
| 34 | const U& b |
| 35 | ) |
| 36 | { |
| 37 | DLIB_TEST(a.nr() == b.nr()); |
| 38 | DLIB_TEST(a.nc() == b.nc()); |
| 39 | typedef typename T::type type; |
| 40 | for (long r = 0; r < a.nr(); ++r) |
| 41 | { |
| 42 | for (long c = 0; c < a.nc(); ++c) |
| 43 | { |
| 44 | type error = std::abs(a(r,c) - b(r,c)); |
| 45 | DLIB_TEST_MSG(error < std::sqrt(std::numeric_limits<type>::epsilon())*eps_mul, "error: " << error << |
| 46 | " eps: " << std::sqrt(std::numeric_limits<type>::epsilon())*eps_mul); |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | template <typename T, typename U> |
| 52 | void c_check_equal ( |