41template <concepts::single_variate_
objective_function ObjectiveFunction>
43 :
public optimizer_base<golden_section_search<ObjectiveFunction>> {
55 using value_type =
typename objective_function_type::value_type;
138 iteration_logger.template append<index_type>(
140 iteration_logger.template append<index_type>(
142 iteration_logger.template append<value_type>(
Class to write logs of iterations.
Class of tags of logs without memory management.
Class of golden section search method.
typename objective_function_type::variable_type variable_type
Type of variables.
auto opt_variable() const -> const variable_type &
Get current optimal variable.
static const auto default_tol_section_len
Default tolerance of length of section between end points.
index_type iterations_
Number of iterations.
ObjectiveFunction objective_function_type
Type of the objective function.
value_type value1_
Function value on end1_.
variable_type tol_section_len_
Tolerance of length of section between end points.
auto tol_section_len(variable_type value) -> golden_section_search &
Set the tolerance of length of section between end points.
auto section_len() const -> variable_type
Get length of section between end points.
objective_function_type obj_fun_
Objective function.
static const auto mid_point_ratio
Ratio of middle point.
auto is_stop_criteria_satisfied() const -> bool
Determine if stopping criteria of the algorithm are satisfied.
typename objective_function_type::value_type value_type
Type of function values.
auto opt_value() const -> const value_type &
Get current optimal value.
auto evaluations() const noexcept -> index_type
Get the number of function evaluations.
void configure_iteration_logger(logging::iterations::iteration_logger< this_type > &iteration_logger) const
Configure an iteration logger.
void change_objective_function(const objective_function_type &obj_fun)
Change the objective function.
variable_type end1_
An end point.
golden_section_search(const objective_function_type &obj_fun=objective_function_type())
Constructor.
variable_type end2_
Another end point.
void iterate()
Iterate the algorithm once.
void init(variable_type end1, variable_type end2)
Initialize the algorithm.
auto iterations() const noexcept -> index_type
Get the number of iterations.
variable_type mid1_
Middle point near to end1_.
Base class of implementations of optimization algorithms.
Definition of index_type type.
Definition of iteration_logger class.
Definition of log_tag_view class.
std::ptrdiff_t index_type
Type of indices in this library.
Namespace of optimization algorithms.
constexpr auto golden_section_search_tag
Tag of golden_section_search.
Definition of optimizer_base class.
Definition of single_variate_objective_function concept.