14 #include <Eigen/Cholesky>
17 using namespace Eigen;
25 const double sampling_interval,
27 const unsigned int seed
29 T_(sampling_interval),
32 generator_(std::mt19937_64(seed_)),
33 distribution_(std::normal_distribution<double>(0.0, 1.0)),
34 gauss_rnd_sample_([&] {
return (distribution_) (generator_); })
36 double q11 = 1.0 / 3.0 * std::pow(T_, 3.0);
37 double q2 = 1.0 / 2.0 * std::pow(T_, 2.0);
63 F_ << F, Matrix2d::Zero(),
67 Q_ << Q, Matrix2d::Zero(),
78 F_ << F, Matrix2d::Zero(), Matrix2d::Zero(),
79 Matrix2d::Zero(), F, Matrix2d::Zero(),
80 Matrix2d::Zero(), Matrix2d::Zero(), F;
83 Q_ << Q, Matrix2d::Zero(), Matrix2d::Zero(),
84 Matrix2d::Zero(), Q, Matrix2d::Zero(),
85 Matrix2d::Zero(), Matrix2d::Zero(), Q;
95 LDLT<MatrixXd> chol_ldlt(Q_);
96 sqrt_Q_ = (chol_ldlt.transpositionsP() * MatrixXd::Identity(Q_.rows(), Q_.cols())).transpose() * chol_ldlt.matrixL() * chol_ldlt.vectorD().real().cwiseSqrt().asDiagonal();
155 const double sampling_interval,
165 const double sampling_interval,
166 const double tilde_q,
167 const unsigned int seed
169 pimpl_(utils::make_unique<ImplData>(dim, sampling_interval, tilde_q, seed))
190 return pimpl_->state_description_;
196 MatrixXd rand_vectors(4, num);
197 for (
int i = 0; i < rand_vectors.size(); i++)
198 *(rand_vectors.data() + i) = pimpl_->gauss_rnd_sample_();
200 return pimpl_->sqrt_Q_ * rand_vectors;