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

#include <types.hpp>

Inheritance diagram for sspace::qlognormal:
sspace::lognormal sspace::normal sspace::param_t

Public Member Functions

 qlognormal (std::string n, double mu, double sigma, double q)
 
double sample ()
 
- Public Member Functions inherited from sspace::lognormal
 lognormal (std::string n, double mu, double sigma)
 
 lognormal (std::string n, double mu, double sigma, pt t)
 
- 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

qlognormal is a quantised parameter which follows a log-normal distribution.

This is suitable for discrete-valued variables with respect to which the objective function becomes smoother as the size of the variable, which is bounded to one size, increases.

Constructor & Destructor Documentation

◆ qlognormal()

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

The constructor

Parameters
nThe name of this parameter
muThe mean of the normal distribution sigma The standard deviation of the normal distribution
qThe quantisation to apply to the output

Member Function Documentation

◆ sample()

double sspace::qlognormal::sample ( )
virtual

Samples values from a quantised exponential normal distribution according to the formula:

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

Reimplemented from sspace::lognormal.


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