MCPcopy Create free account
hub / github.com/davisking/dlib / check_equal

Function check_equal

dlib/test/matrix3.cpp:32–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 (

Callers 1

test_blasFunction · 0.85

Calls 4

absFunction · 0.85
sqrtFunction · 0.50
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected