OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Private Attributes | List of all members
__gs::node Class Reference
Inheritance diagram for __gs::node:
__gs::param

Public Member Functions

 node (const std::string &k)
 
 ~node ()
 
void add_item (param *p)
 
subspacesget_subspaces ()
 
paramsget_values ()
 
inst::paramclone ()
 
inst::set step (inst::node *parent, bool *complete)
 
- Public Member Functions inherited from __gs::param
 param (const std::string &k, pspace_t t)
 
pspace_t get_type ()
 
std::string get_key ()
 

Private Attributes

params values
 
subspaces nodes
 
std::vector< inst::param * > local_params
 

Detailed Description

A node contains the parameters for this 'level' of the search space, including concrete parameters, and nested search spaces.

Constructor & Destructor Documentation

◆ node()

__gs::node::node ( const std::string &  k)

Construct a gridsearch node parameter with the given key.

Parameters
kThe idenfying key of this subspace.

◆ ~node()

__gs::node::~node ( )

This destructor will free all the local gridsearch nodes and values allocated on the heap.

Member Function Documentation

◆ add_item()

void __gs::node::add_item ( param p)

Add a parameter or subspace to this 'level' of the search space. Addition of parameters after the first call to generate_parameters results in undefined behaviour.

Parameters
pThe new parameter to add.

◆ clone()

inst::param * __gs::node::clone ( )

This creates a full copy of a node and all nested subspaces with the current values of local_params with memory allocated on the heap. This is used when iterating through values, and a subspace does not need to be updated.

◆ get_subspaces()

subspaces* __gs::node::get_subspaces ( )
inline

Get the list of subspaces registered at this node.

◆ get_values()

params* __gs::node::get_values ( )
inline

Get the list of parameters in this (sub) search space.

◆ step()

inst::set __gs::node::step ( inst::node parent,
bool *  complete 
)

This will iterate through all the concrete parameters once, before calling step on each of the the elemnts in the nodes array.

Parameters
parentA pointer to the node instance to which to add parameter values.
completeA pointer to a boolean value which will be set to true if all values have been iterated over for this node.
Returns
A pointer to a root node.

Member Data Documentation

◆ local_params

std::vector<inst::param *> __gs::node::local_params
private

This is a vector of all the non-node parameter instances.

◆ nodes

subspaces __gs::node::nodes
private

A local list of all the subspaces at this level in the search space; all parameter pointers in this array have type pspace_t::node.

◆ values

params __gs::node::values
private

A local list of all the values at this level of the search space; all param pointers in this array have type pspace_t::value.


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