|
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_TREELESS_CONTROLLER_HPP__
8 #define JADE_TREELESS_CONTROLLER_HPP__
10 #include "jade.controller.hpp"
19 template <
typename TValue>
51 const auto & c = this->
get_c();
52 const auto rk = this->
get_rk();
53 assert(c.get_height() == rk);
63 params.reserve(rk + ((rk * rk) - rk) / 2);
69 auto src_ptr = c.get_data();
70 auto src_end = c.get_data() + rk;
75 for (
size_t i = 0; i < rk; i++)
85 while (src_ptr != src_end)
86 params.push_back(*src_ptr++);
109 const auto rk = this->
get_rk();
118 assert(src.size() == rk + ((rk * rk) - rk) / 2);
125 auto src_ptr = src.data();
126 const auto src_end = src.data() + src.size();
131 while (src_ptr != src_end)
136 const auto anchor = dst_ptr;
141 for (; dst_ptr != dst_end; dst_ptr += rk)
142 *dst_ptr = *src_ptr++;
148 dst_ptr = anchor + rk + 1;
160 #endif // JADE_TREELESS_CONTROLLER_HPP__
A template for a class that performs the Nelder-Mead optimization. This class implements shared featu...
const value_type * get_data() const
basic_matrix< value_type > matrix_type
The matrix type.
size_t get_length() const
basic_controller< TValue >::container_type container_type
The container type for the controller.
simplex_type::container_type container_type
The container type for the simplex.
A template for a class that encodes and decodes parameters for the Nelder-Mead algorithm....
TValue value_type
The value type.
basic_treeless_controller(const settings_type &settings)
Initializes a new instance of the class based on the specified program settings.
A template for a class encapsulating the settings provided to the optimizer.
virtual bool _decode_lower(matrix_type &dst, const container_type &src) override
Decodes the specified Nelder-Mead container and stores the result into the lower triangle,...
virtual container_type init_parameters() override
Creates and returns the initial set of parameters for the Nelder- Mead algorithm.
const matrix_type & get_c() const
basic_settings< value_type > settings_type
The settings type.