12 #include <gtest/gtest.h> 22 { 0.0 , .0 , 0.0 , 1.0 , 0.0 },
23 { 1.0 , .0 , 1.0 , 1.0 , 0.0 },
24 { 10.0 , .0 , 10.0 , 1.0 , 0.0 }
29 { 0.0 , 1.0 , 0.0 , 1.0 ,-0.5 },
30 { 0.0 , 4.0 , 0.0 , 1.0 ,-0.125 },
31 { 0.0 , 9.0 , 0.0 , 1.0 ,-0.0555556 },
32 { 1.0 , 1.0 , 0.828427 , 0.707107 ,-0.176777 },
33 { 1.0 , 4.0 , 0.944272 , 0.894427 ,-0.0894427 },
34 { 1.0 , 9.0 , 0.973666 , 0.948683 ,-0.0474342 },
35 { 4.0 , 1.0 , 2.47214 , 0.447214 ,-0.0447214 },
36 { 4.0 , 4.0 , 3.31371 , 0.707107 ,-0.0441942 },
37 { 4.0 , 9.0 , 3.63331 , 0.83205 ,-0.0320019 }
40 template <TRobustKernelType KERNEL_TYPE>
45 for (
size_t i=0;i<N;i++)
47 const double e2 =
table[i][0];
48 const double param2 =
table[i][1];
51 rKernel.param_sq = param2;
52 double r2 = rKernel.eval(e2,rhop,rhopp);
54 const double expected_r2 =
table[i][2];
55 const double expected_rhop =
table[i][3];
56 const double expected_rhopp =
table[i][4];
58 EXPECT_NEAR(r2,expected_r2,1e-5);
59 EXPECT_NEAR(rhop,expected_rhop,1e-5);
60 EXPECT_NEAR(rhopp,expected_rhopp,1e-5);
64 TEST(RobustKernels,PlainLeastSquares)
70 TEST(RobustKernels,PseudoHuber)
const double list_test_kernel_pshb[][5]
GLenum GLsizei GLenum GLenum const GLvoid * table
void tester_robust_kernel(const double table[][5], const size_t N)
This base provides a set of functions for maths stuff.
const double list_test_kernel_none[][5]
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TEST(RobustKernels, PlainLeastSquares)