33 #define _USE_MATH_DEFINES 41 template <
typename FLT_TYPE =
float>
47 a_ = 1.0 / std::sqrt(2.0 * M_PI * sigma * sigma);
48 sq2_ = sigma * sigma * 2.0;
52 return a_ * expf(-x * x /
sq2_);
60 template <
typename FLT_TYPE =
float,
size_t DIMENSION = 6>
64 using Matrix = Eigen::Matrix<FLT_TYPE, DIMENSION, DIMENSION>;
65 using Vector = Eigen::Matrix<FLT_TYPE, DIMENSION, 1>;
69 a_ = 1.0 / (std::pow(2.0 * M_PI, 0.5 * DIMENSION) * std::sqrt(sigma.determinant()));
70 sigma_inv_ = sigma.inverse();
74 return a_ * std::exp(static_cast<FLT_TYPE>(-0.5 * x.transpose() * sigma_inv_ * x));
83 #endif // MCL_3DL_ND_H
FLT_TYPE operator()(const Vector x) const
FLT_TYPE operator()(const FLT_TYPE x) const
NormalLikelihoodNd(const Matrix sigma)
NormalLikelihood(const FLT_TYPE sigma)
Eigen::Matrix< FLT_TYPE, DIMENSION, DIMENSION > Matrix
Eigen::Matrix< FLT_TYPE, DIMENSION, 1 > Vector