OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Public Attributes | List of all members
sspace::qnormal Class Reference

#include <types.hpp>

Inheritance diagram for sspace::qnormal:
sspace::normal sspace::param_t

Public Member Functions

 qnormal (std::string n, double mu, double sigma, double q)
 
double sample ()
 
- Public Member Functions inherited from sspace::normal
 normal (std::string n, double mu, double sigma)
 
 normal (std::string n, double mu, double sigma, pt t)
 
- Public Member Functions inherited from sspace::param_t
 param_t (std::string n, pt t)
 
virtual ~param_t ()
 
virtual pt get_type ()
 
virtual std::string get_name ()
 

Public Attributes

double m_q
 
- Public Attributes inherited from sspace::normal
double m_mu
 
double m_sigma
 

Additional Inherited Members

- Protected Attributes inherited from sspace::normal
std::random_device rd
 
std::mt19937 generator
 
std::normal_distribution< double > dist
 

Detailed Description

qnormal is for discrete-valued variables which probably take a value of mu.

These variables are still fundamentally unbounded.

Constructor & Destructor Documentation

◆ qnormal()

sspace::qnormal::qnormal ( std::string  n,
double  mu,
double  sigma,
double  q 
)

the constructor

Parameters
nThe name of this parameter
muThe mean of the normal distribution
sigmaThe standard deviation of the normal distribution
qThe quantisation for the sampled values

Member Function Documentation

◆ sample()

double sspace::qnormal::sample ( )
virtual

Sample a value from the quantised normal distribution according to the following:

\[ v = \text{round}\big(\text{normal}(\mu, \sigma) / q\big) \cdot q. \]

Reimplemented from sspace::normal.


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