pf
pf::rvsamp::UnivNormSampler< float_t > Class Template Reference

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

#include <rv_samp.h>

Inheritance diagram for pf::rvsamp::UnivNormSampler< float_t >:
Collaboration diagram for pf::rvsamp::UnivNormSampler< float_t >:

Public Member Functions

 UnivNormSampler ()
 Default-constructor sets up for standard Normal random variate generation.
 
 UnivNormSampler (float_t mu, float_t sigma)
 The user must supply both mean and std. dev. More...
 
void setStdDev (float_t sigma)
 sets the standard deviation of the sampler. More...
 
void setMean (float_t mu)
 sets the mean of the sampler. More...
 
float_t sample ()
 Draws a random number. 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
 
float_t m_mu
 the mean
 
float_t m_sigma
 the standard deviation
 

Additional Inherited Members

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

Detailed Description

template<typename float_t>
class pf::rvsamp::UnivNormSampler< float_t >

A class that performs sampling from a univariate Normal distribution.

Author
taylor

Constructor & Destructor Documentation

◆ UnivNormSampler()

template<typename float_t >
pf::rvsamp::UnivNormSampler< float_t >::UnivNormSampler ( float_t  mu,
float_t  sigma 
)

The user must supply both mean and std. dev.

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

Member Function Documentation

◆ sample()

template<typename float_t >
float_t pf::rvsamp::UnivNormSampler< float_t >::sample

Draws a random number.

Returns
a random sample of type float_t.

◆ setMean()

template<typename float_t >
void pf::rvsamp::UnivNormSampler< float_t >::setMean ( float_t  mu)

sets the mean of the sampler.

Parameters
muthe desired mean.

◆ setStdDev()

template<typename float_t >
void pf::rvsamp::UnivNormSampler< float_t >::setStdDev ( float_t  sigma)

sets the standard deviation of the sampler.

Parameters
sigmathe desired standard deviation.

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