Random distribution for drawing samples from univariate or multivariate normal distributions.
More...
template<int D, typename T = float>
class mira::NormalRandomDistribution< D, T >
Random distribution for drawing samples from univariate or multivariate normal distributions.
This class template models a zero-mean normal distribution of the specified dimension D (univariate if D==1 or multivariate if D>1).
It can be used with any of the boost random number generators:
boost::mt19937 engine;
NormalRandomDistribution<2,float> nrnd(Sigma);
boost::variate_generator<boost::mt19937&, NormalRandomDistribution<2,float>> rnd(engine, nrnd);
Eigen::Vector2f sample = rnd();
The above instantiation is simplified by the NormalRandomGenerator.
Sets the specified covariance matrix.
The method assumes that the provided matrix is symmetric and uses the lower triangular part of the matrix only. The upper triangular part won't be read. If the matrix is not a positive definite matrix the member mL will not set and the method returns false, and otherwise true.
Internally a cholesky decomposition (LLT) of the covariance matrix is performed.