10 #ifndef mrpt_robust_kernels_H 11 #define mrpt_robust_kernels_H 35 template <TRobustKernelType KERNEL_TYPE,
typename T =
double>
49 inline T
eval(
const T r2, T& out_1st_deriv, T& out_2nd_deriv)
68 inline T
eval(
const T r2, T& out_1st_deriv, T& out_2nd_deriv)
70 const T param_sq_inv = 1.0 / param_sq;
71 const T
a = 1 + r2 * param_sq_inv;
72 const T
b = std::sqrt(
a);
73 out_1st_deriv = 1. /
b;
74 out_2nd_deriv = -0.5 * param_sq_inv * out_1st_deriv /
a;
75 return 2 * param_sq * (
b - 1);
T eval(const T r2, T &out_1st_deriv, T &out_2nd_deriv)
Evaluates the kernel function for the squared error r2 and returns robustified squared error and deri...
T param_sq
The kernel parameter (the "threshold") squared [Not used in this class, provided for consistency with...
Pseudo-huber robust kernel.
T eval(const T r2, T &out_1st_deriv, T &out_2nd_deriv)
Evaluates the kernel function for the squared error r2 and returns robustified squared error and deri...
No robust kernel, use standard least squares: rho(r)= 1/2 * r^2.
TRobustKernelType
The different types of kernels for usage within a robustified least-squares estimator.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte a
T param_sq
The kernel parameter (the "threshold") squared.