|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <synthetic.hpp>
Public Member Functions | |
| synthetic (const std::string &n, u_int dims, double lb, double ub, double opt) | |
| synthetic (const std::string &n, u_int dims, double opt) | |
| ~synthetic () | |
| sspace::sspace_t * | get_search_space () |
| void | set_properties (std::vector< properties > p) |
| std::vector< properties > | get_properties () |
| inst::set | get_opt_param () |
| double | get_opt () |
| void | update_opt (double opt) |
| u_int | get_dims () |
| void | validate_param_set (inst::set x) |
Public Member Functions inherited from optk::benchmark | |
| benchmark (const std::string &name) | |
| std::string | get_name () |
| virtual double | evaluate (inst::set x)=0 |
Protected Member Functions | |
| void | set_opt_param (inst::set op) |
Protected Attributes | |
| u_int | m_dims |
| double | m_lb |
| double | m_ub |
| double | m_opt |
| std::vector< properties > | m_properties |
| inst::set | opt_params |
| sspace::sspace_t | m_sspace |
Protected Attributes inherited from optk::benchmark | |
| std::string | m_name |
Owing to the similarity of the structure, and subsequent exposition, of the 175 functions in Jamil et al. 2013, we use this as base class for the synthetic benchmarks.
| syn::synthetic::synthetic | ( | const std::string & | n, |
| u_int | dims, | ||
| double | lb, | ||
| double | ub, | ||
| double | opt | ||
| ) |
Base constructor for synthetic benchmarks. Unless overidden by derived calsses, this will expand the provided lower bound, upper bound and dimensionality to a uniform bounded parameter space of type sspace::sspace_t, making use of heap memory allocations.
| n | The name of the benchmark. |
| dims | The number of dimensions in which to run this benchmark. |
| lb | The lower bound on the parameters constituting the search space. |
| up | The corresponding upper bound. |
| opt | The global minimum for this function. |
| opt_param | The optimal parameters for this function. |
| syn::synthetic::synthetic | ( | const std::string & | n, |
| u_int | dims, | ||
| double | opt | ||
| ) |
A simpler base constructor for synthetic benchmarks which have more complicated search spaces which will be manually set in the derived class' constructor.
| n | The name of the benchmark |
| dims | The number of dimensions of this benchmark |
| opt | The global minimum |
| syn::synthetic::~synthetic | ( | ) |
This destructor frees the search space which was automatically-generated in the constructor.
|
inline |
Get the number of dimensions that this problem was instantiated with; or the fixed dimension that the derived function can take.
|
inline |
Returns (one of) the known global minima.
|
inline |
Returns the known optimal parameter set.
|
inlinevirtual |
Implements optk::benchmark.
|
protected |
Sets the parameters which give the optimum when evaluated. This set needn't be unique; for instance in multimodal functions it is not.
Only call once from the constructor of a derived class; multiple invocations leads to memory leaks. It is 'protected' to guard against this.
| op | The set of optimal parameter instances. |
|
inline |
This is specific to synthetic benchmarks, and sets the properties of the derived benchmark function (e.g. non-separable, scalable etc...)
| p | A vector of elements from the properties enum. |
|
inline |
Update the value of the global minimum.
| void syn::synthetic::validate_param_set | ( | inst::set | x | ) |
This function validates that a set of parameter instances provided to be evaluated is compatible with the search space.
| x | The search space provided by the optimisation algorithm. |
| std::invalid_argument | when the parameter set instance is invalid. |
1.8.13