UniformSampler Class Reference

Uniform/Log-uniform distribution sampler. More...

#include <Randomiser.hh>

Public Member Functions

 UniformSampler (double a, double b, bool log_uniform=false)
 Constructor. More...
 
 ~UniformSampler () override
 Destructor. More...
 
double sample (std::mt19937 &gen) override
 Gets random sample. More...
 
- Public Member Functions inherited from IRandomSampler
virtual ~IRandomSampler ()
 Destructor. More...
 

Public Attributes

std::uniform_real_distribution< double > dist
 Uniform distribution. More...
 

Private Attributes

double a
 Uniform lower limit. More...
 
double b
 Uniform higher limit. More...
 
bool log_uniform {false}
 Whether to use log-uniform instead. More...
 

Detailed Description

Uniform/Log-uniform distribution sampler.

Constructor & Destructor Documentation

UniformSampler ( double  a,
double  b,
bool  log_uniform = false 
)

Constructor.

Parameters
aDomain lower limit
bDomain upper limit
log_uniformWhether to use log-uniform or uniform dist
~UniformSampler ( )
inlineoverride

Destructor.

Member Function Documentation

double sample ( std::mt19937 &  gen)
overridevirtual

Gets random sample.

Parameters
genPseudo random number generator
Returns
Random sample

Reimplemented from IRandomSampler.

Member Data Documentation

double a
private

Uniform lower limit.

double b
private

Uniform higher limit.

std::uniform_real_distribution<double> dist

Uniform distribution.

bool log_uniform {false}
private

Whether to use log-uniform instead.


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