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

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

#include <rv_samp.h>

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

Public Member Functions

 TruncUnivNormSampler (float_t mu, float_t sigma, float_t lower, float_t upper)
 The user must supply both mean and std. dev. 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
 
float_t m_lower
 the lower bound
 
float_t m_upper
 the upper bound
 

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::TruncUnivNormSampler< float_t >

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

Author
taylor

Constructor & Destructor Documentation

◆ TruncUnivNormSampler()

template<typename float_t >
pf::rvsamp::TruncUnivNormSampler< float_t >::TruncUnivNormSampler ( float_t  mu,
float_t  sigma,
float_t  lower,
float_t  upper 
)

The user must supply both mean and std. dev.

Parameters
mua float_t for the location parameter.
sigmaa float_t (> 0) representing the scale of the samples.
lowerthe lower bound of the support
upperthe upper bound of the support

Member Function Documentation

◆ sample()

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

Draws a random number.

Returns
a random sample of type float_t.

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