|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| categorical (std::string n, std::vector< int > *options) | |
| categorical (std::string n, std::vector< double > *options) | |
| categorical (std::string n, std::vector< std::string > *options) | |
| std::vector< T > * | values () |
| long unsigned int | count () |
| T | get (long unsigned int i) |
| T | 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 () |
Private Member Functions | |
| void | init_rand () |
Private Attributes | |
| std::vector< T > | m_options |
| std::random_device | rd |
| std::mt19937 | generator |
| std::uniform_int_distribution< int > | dist |
A class to represent the choice between a finite list of static values.
Common choices of value types include integers, double-precision floating point numbers, as well as strings. These are all used to model categorical paramteters.
This type also serves to terminate the recursion for a choice type (see below).
|
inline |
Constructor for integer-valued categorical parameter.
| n | the parameter's name |
| options | an array of doubles (passed by value) |
|
inline |
Constructor for double-valued categorical parameter.
| n | the parameter's name |
| options | an array of doubles (passed by value) |
|
inline |
Constructor for string-valued categorical parameter.
| n | the parameter's name |
| options | an array of doubles (passed by value) |
|
inline |
Counts the number of options.
|
inline |
Retreives the value of the ith element
| i | the index of the option |
| std::range_error |
|
inlineprivate |
Called from constructors; initialises the random number generator.
|
inline |
Sample a random value uniformly at random from the list of values.
|
inline |
values
1.8.13