OPTK  0.1.2
Toolkit for global optimisation algorithms
Classes | Typedefs | Enumerations | Functions
__gs Namespace Reference

Classes

class  node
 
class  param
 
class  value
 

Typedefs

typedef std::vector< std::tuple< std::string, node * > > subspaces
 
typedef std::vector< std::tuple< std::string, param * > > params
 

Enumerations

enum  pspace_t : char { node, int_val, dbl_val, str_val }
 

Functions

static void iterate_local_params (bool *cont, inst::node *parent, params *values, std::vector< inst::param *> *local_params)
 
static void iterate_subspaces (bool *cont, inst::node *parent, subspaces *nodes)
 

Detailed Description

This namespace contains types which are specific to the gridsearch algorithm

Typedef Documentation

◆ params

typedef std::vector<std::tuple<std::string, param *> > __gs::params

params is a list of key, value pairs; here represented as the base class __gs::param, values must be cast to their concrete type before use upon access.

◆ subspaces

typedef std::vector<std::tuple<std::string, node *> > __gs::subspaces

Subspaces is a list of key, node pairs

Function Documentation

◆ iterate_local_params()

static void __gs::iterate_local_params ( bool *  cont,
inst::node parent,
params values,
std::vector< inst::param *> *  local_params 
)
static

This is a local method called from the __gs::node::step function which iterates through the parameters at this point in the search space.

Parameters
contA boolean used to indicate whether the next value should be incremented or simply copied.
parentThe parent node instance to which the parameter instances are added.
valuesThe description of the parameters at this level of the search space.
local_paramsConcrete instances of the parameters at this level of the search space.

◆ iterate_subspaces()

static void __gs::iterate_subspaces ( bool *  cont,
inst::node parent,
subspaces nodes 
)
static

This function is also called from __gs::node::step. If it is called before iterate_local_params, then a depth-first search is realised, otherwise gridsearch performs a breadth-first search.

Parameters
contA boolean indicating whether or not the next searchspace along in the list should be updated.
parentThe node instance to which to add the instances of each node at this level in the search space.
nodesThe list of nodes registered at this level of the search space.