ʻOhana
Population structure, admixture history, and selection using learning methods.
Public Member Functions | Data Fields
jade::basic_simplex< TValue >::options Struct Reference

A data structure used to initialize the Nelder-Mead algorithm. More...

#include <jade.simplex.hpp>

+ Collaboration diagram for jade::basic_simplex< TValue >::options:

Public Member Functions

 options (const size_t n)
 Initializes a new instance of the class. More...
 
 options (const container_type &vertex_)
 Initializes a new instance of the class. More...
 
std::string str () const
 

Data Fields

container_type vertex
 A vertex in the initial formation of the simplex. More...
 
value_type chi
 The expansion coefficient, which must be greater than the larger or rho or 1.0. More...
 
value_type gamma
 The contraction coefficient, which must be greater than 0.0 and less than 1.0. More...
 
value_type rho
 The reflection coefficient, which must be greater than 0.0. More...
 
value_type sigma
 The shrinkage coefficient, which must be greater than 0.0 and less than 1.0. More...
 
value_type unit
 A scaling coefficient used to construct the unit vectors in each dimension of the simplex, or undefined to use 1.0. More...
 

Detailed Description

template<typename TValue>
struct jade::basic_simplex< TValue >::options

A data structure used to initialize the Nelder-Mead algorithm.

The default values for rho, chi, gamma, and sigma are based on the 2010 paper 'Implementing the Nelder-Mead simplex algorithm with adaptive parameters' by Fuchang Gao and Lixing Han.

Definition at line 302 of file jade.simplex.hpp.

Constructor & Destructor Documentation

◆ options() [1/2]

template<typename TValue >
jade::basic_simplex< TValue >::options::options ( const size_t  n)
inlineexplicit

Initializes a new instance of the class.

Parameters
nThe container size.

Definition at line 341 of file jade.simplex.hpp.

343  : vertex ()
344  , chi (_init_chi(n))
345  , gamma (_init_gamma(n))
346  , rho (1)
347  , sigma (_init_sigma(n))
348  , unit (1)
349  {
350  assert(n > 0);
351  vertex.resize(n);
352  }

◆ options() [2/2]

template<typename TValue >
jade::basic_simplex< TValue >::options::options ( const container_type vertex_)
inlineexplicit

Initializes a new instance of the class.

Parameters
vertex_The container size.

Definition at line 357 of file jade.simplex.hpp.

359  : vertex (vertex_)
360  , chi (_init_chi(vertex.size()))
361  , gamma (_init_gamma(vertex.size()))
362  , rho (1)
363  , sigma (_init_sigma(vertex.size()))
364  , unit (1)
365  {
366  assert(vertex.size() > 0);
367  }

Member Function Documentation

◆ str()

template<typename TValue >
std::string jade::basic_simplex< TValue >::options::str ( ) const
inline
Returns
A string representation of the class.

Definition at line 372 of file jade.simplex.hpp.

373  {
374  std::ostringstream out;
375 
376  out << "vertex: {";
377  auto iter = vertex.begin();
378  if (iter != vertex.end())
379  {
380  out << *iter;
381  while (++iter != vertex.end())
382  out << "," << *iter;
383  }
384  out << "}" << std::endl;
385 
386  out
387  << "chi: " << chi << std::endl
388  << "gamma: " << gamma << std::endl
389  << "rho: " << rho << std::endl
390  << "sigma: " << sigma << std::endl
391  << "unit: " << unit << std::endl;
392 
393  return out.str();
394  }

Field Documentation

◆ chi

template<typename TValue >
value_type jade::basic_simplex< TValue >::options::chi

The expansion coefficient, which must be greater than the larger or rho or 1.0.

Definition at line 313 of file jade.simplex.hpp.

◆ gamma

template<typename TValue >
value_type jade::basic_simplex< TValue >::options::gamma

The contraction coefficient, which must be greater than 0.0 and less than 1.0.

Definition at line 319 of file jade.simplex.hpp.

◆ rho

template<typename TValue >
value_type jade::basic_simplex< TValue >::options::rho

The reflection coefficient, which must be greater than 0.0.

Definition at line 324 of file jade.simplex.hpp.

◆ sigma

template<typename TValue >
value_type jade::basic_simplex< TValue >::options::sigma

The shrinkage coefficient, which must be greater than 0.0 and less than 1.0.

Definition at line 330 of file jade.simplex.hpp.

◆ unit

template<typename TValue >
value_type jade::basic_simplex< TValue >::options::unit

A scaling coefficient used to construct the unit vectors in each dimension of the simplex, or undefined to use 1.0.

Definition at line 336 of file jade.simplex.hpp.

◆ vertex

template<typename TValue >
container_type jade::basic_simplex< TValue >::options::vertex

A vertex in the initial formation of the simplex.

Definition at line 307 of file jade.simplex.hpp.


The documentation for this struct was generated from the following file:
jade::basic_simplex::options::gamma
value_type gamma
The contraction coefficient, which must be greater than 0.0 and less than 1.0.
Definition: jade.simplex.hpp:319
jade::basic_simplex::options::sigma
value_type sigma
The shrinkage coefficient, which must be greater than 0.0 and less than 1.0.
Definition: jade.simplex.hpp:330
jade::basic_simplex::options::chi
value_type chi
The expansion coefficient, which must be greater than the larger or rho or 1.0.
Definition: jade.simplex.hpp:313
jade::basic_simplex::options::vertex
container_type vertex
A vertex in the initial formation of the simplex.
Definition: jade.simplex.hpp:307
jade::basic_simplex::options::unit
value_type unit
A scaling coefficient used to construct the unit vectors in each dimension of the simplex,...
Definition: jade.simplex.hpp:336
jade::basic_simplex::options::rho
value_type rho
The reflection coefficient, which must be greater than 0.0.
Definition: jade.simplex.hpp:324