pf
pf::UnivNormSampler Class Reference

A class that performs sampling from a univariate Normal distribution. More...

#include <rv_samp.h>

Inheritance diagram for pf::UnivNormSampler:
Collaboration diagram for pf::UnivNormSampler:

Public Member Functions

 UnivNormSampler ()
 Default-constructor sets up for standard Normal random variate generation.
 
 UnivNormSampler (const double &mu, const double &sigma)
 The user must supply both mean and std. dev. More...
 
void setStdDev (const double &sigma)
 sets the standard deviation of the sampler. More...
 
void setMean (const double &mu)
 sets the mean of the sampler. More...
 
double sample ()
 Draws a random number. More...
 
- Public Member Functions inherited from pf::rvsamp_base< 1 >
 rvsamp_base ()
 The default constructor. This is the only option available. Sets the seed with the clock.
 

Private Attributes

std::normal_distribution m_z_gen
 makes normal random variates
 
double m_mu
 the mean
 
double m_sigma
 the standard deviation
 

Additional Inherited Members

- Public Types inherited from pf::rvsamp_base< 1 >
using ssv = Eigen::Matrix< double, dim, 1 >
 
- Protected Attributes inherited from pf::rvsamp_base< 1 >
std::mt19937 m_rng
 prng
 

Detailed Description

A class that performs sampling from a univariate Normal distribution.

Author
taylor

Constructor & Destructor Documentation

pf::UnivNormSampler::UnivNormSampler ( const double &  mu,
const double &  sigma 
)

The user must supply both mean and std. dev.

Parameters
mua double for the mean of the sampling distribution.
sigmaa double (> 0) representing the standard deviation of the samples.

Member Function Documentation

double pf::UnivNormSampler::sample ( )

Draws a random number.

Returns
a random sample of type double.
void pf::UnivNormSampler::setMean ( const double &  mu)

sets the mean of the sampler.

Parameters
muthe desired mean.
void pf::UnivNormSampler::setStdDev ( const double &  sigma)

sets the standard deviation of the sampler.

Parameters
sigmathe desired standard deviation.

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