pf
pf::rvsamp::MVNSampler< dim, float_t > Class Template Reference

A class that performs sampling from a multivariate normal distribution. More...

#include <rv_samp.h>

Inheritance diagram for pf::rvsamp::MVNSampler< dim, float_t >:
Collaboration diagram for pf::rvsamp::MVNSampler< dim, float_t >:

Public Types

using Vec = Eigen::Matrix< float_t, dim, 1 >
 
using Mat = Eigen::Matrix< float_t, dim, dim >
 

Public Member Functions

 MVNSampler ()
 Default-constructor sets up for multivariate standard Normal random variate generation. More...
 
 MVNSampler (const Vec &meanVec, const Mat &covMat)
 The user must supply both mean and covariance matrix. More...
 
void setCovar (const Mat &covMat)
 sets the covariance matrix of the sampler. More...
 
void setMean (const Vec &meanVec)
 sets the mean vector of the sampler. More...
 
auto sample () -> Vec
 Draws a random vector. More...
 
- Public Member Functions inherited from pf::rvsamp::rvsamp_base
 rvsamp_base ()
 The default constructor. This is the only option available. Sets the seed with the clock.
 

Private Attributes

std::normal_distribution< float_t > m_z_gen
 makes normal random variates
 
Mat m_scale_mat
 covariance matrix
 
Vec m_mean
 mean vector
 

Additional Inherited Members

- Protected Attributes inherited from pf::rvsamp::rvsamp_base
std::mt19937 m_rng
 prng
 

Detailed Description

template<size_t dim, typename float_t>
class pf::rvsamp::MVNSampler< dim, float_t >

A class that performs sampling from a multivariate normal distribution.

Author
taylor

Member Typedef Documentation

◆ Mat

template<size_t dim, typename float_t >
using pf::rvsamp::MVNSampler< dim, float_t >::Mat = Eigen::Matrix<float_t,dim,dim>

type alias for linear algebra stuff

◆ Vec

template<size_t dim, typename float_t >
using pf::rvsamp::MVNSampler< dim, float_t >::Vec = Eigen::Matrix<float_t,dim,1>

type alias for linear algebra stuff

Constructor & Destructor Documentation

◆ MVNSampler() [1/2]

template<size_t dim, typename float_t >
pf::rvsamp::MVNSampler< dim, float_t >::MVNSampler

Default-constructor sets up for multivariate standard Normal random variate generation.

Todo:
: implement move semantics

◆ MVNSampler() [2/2]

template<size_t dim, typename float_t >
pf::rvsamp::MVNSampler< dim, float_t >::MVNSampler ( const Vec meanVec,
const Mat covMat 
)

The user must supply both mean and covariance matrix.

Parameters
meanVeca Vec for the mean vector of the sampling distribution.
covMata Mat representing the covariance matrix of the samples.

Member Function Documentation

◆ sample()

template<size_t dim, typename float_t >
auto pf::rvsamp::MVNSampler< dim, float_t >::sample

Draws a random vector.

Returns
a Vec random sample.

◆ setCovar()

template<size_t dim, typename float_t >
void pf::rvsamp::MVNSampler< dim, float_t >::setCovar ( const Mat covMat)

sets the covariance matrix of the sampler.

Parameters
covMatthe desired covariance matrix.

◆ setMean()

template<size_t dim, typename float_t >
void pf::rvsamp::MVNSampler< dim, float_t >::setMean ( const Vec meanVec)

sets the mean vector of the sampler.

Parameters
meanVecthe desired mean vector.

The documentation for this class was generated from the following file: