37 #ifndef MULTIVARIATE_GAUSSIAN_H_ 38 #define MULTIVARIATE_GAUSSIAN_H_ 40 #include <eigen3/Eigen/Core> 41 #include <eigen3/Eigen/Cholesky> 42 #include <boost/random/variate_generator.hpp> 43 #include <boost/random/normal_distribution.hpp> 44 #include <boost/random/mersenne_twister.hpp> 55 template <
typename Derived1,
typename Derived2>
56 MultivariateGaussian(
const Eigen::MatrixBase<Derived1>& mean,
const Eigen::MatrixBase<Derived2>& covariance);
58 template <
typename Derived>
59 void sample(Eigen::MatrixBase<Derived>& output);
69 boost::variate_generator<boost::mt19937, boost::normal_distribution<> >
gaussian_;
74 template <
typename Derived1,
typename Derived2>
76 const Eigen::MatrixBase<Derived2>& covariance)
88 template <
typename Derived>
91 for (
int i = 0; i <
size_; ++i)
Eigen::MatrixXd covariance_cholesky_
Generates samples from a multivariate gaussian distribution.
void sample(Eigen::MatrixBase< Derived > &output)
Eigen::MatrixXd covariance_
boost::variate_generator< boost::mt19937, boost::normal_distribution<> > gaussian_
MultivariateGaussian(const Eigen::MatrixBase< Derived1 > &mean, const Eigen::MatrixBase< Derived2 > &covariance)
boost::normal_distribution normal_dist_