|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| uniform (std::string n, double lower, double upper) | |
| uniform (std::string n, double lower, double upper, pt type) | |
| virtual double | sample () |
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_lower |
| double | m_upper |
Protected Attributes | |
| std::random_device | rd |
| std::mt19937 | generator |
| std::uniform_real_distribution< double > | dist |
A uniform parameter is real-valued and sampled uniformly at random between the lower and upper bound (inclusive).
| sspace::uniform::uniform | ( | std::string | n, |
| double | lower, | ||
| double | upper | ||
| ) |
The constructor to be used when instantiating a uniform parameter manually.
| n | the name of this parameter |
| lower | the lower bound; as a double |
| upper | the upper bound; as a double |
| sspace::uniform::uniform | ( | std::string | n, |
| double | lower, | ||
| double | upper, | ||
| pt | type | ||
| ) |
This constructor is used by classes inheriting from uniform, and uses run-time polymorphism to set the desired type (per the inheriting class).
It should (probably) never be called directly.
|
virtual |
Produces a double-precision value drawn uniformly at random from the given range.
This is a virtual method to allow for runtime polymorphism when using derived classes in the choice parameter type.
Reimplemented in sspace::qloguniform, sspace::loguniform, and sspace::quniform.
| double sspace::uniform::m_lower |
Lower and upper bounds on the uniform distribution.
1.8.13