30 #ifndef EXOTICA_CORE_TOOLS_SPARSE_COSTS_H_ 31 #define EXOTICA_CORE_TOOLS_SPARSE_COSTS_H_ 34 #include <Eigen/Dense> 41 if (std::abs(x) < beta)
44 return beta * (std::abs(x) - 0.5 * beta);
49 if (std::abs(x) < beta)
58 if (std::abs(x) < beta)
65 if (std::abs(x) < beta)
66 return 0.5 * x * x / beta;
67 return std::abs(x) - 0.5 * beta;
72 if (std::abs(x) < beta)
81 if (std::abs(x) < beta)
88 return beta * beta * (std::sqrt(1 + std::pow(x / beta, 2)) - 1.0);
93 return x / (std::sqrt(1.0 + x * x / (beta * beta)));
98 return std::pow(beta, 4) * std::sqrt(1.0 + x * x / (beta * beta)) / (std::pow(beta * beta + x * x, 2));
103 #endif // EXOTICA_CORE_TOOLS_SPARSE_COSTS_H_ double huber_jacobian(double x, double beta)
double smooth_l1_cost(double x, double beta)
double pseudo_huber_jacobian(double x, double beta)
double smooth_l1_hessian(double x, double beta)
double smooth_l1_jacobian(double x, double beta)
double huber_cost(double x, double beta)
double pseudo_huber_cost(double x, double beta)
double pseudo_huber_hessian(double x, double beta)
double huber_hessian(double x, double beta)