Developer documentation
Version 3.0.3-105-gd3941f44
Optimisation

Classes

class  MR::Math::QuadraticLineSearch< ValueType >
 Computes the minimum of a 1D function using a quadratic line search. More...
 

Functions

template<class FunctionType , typename ValueType >
ValueType MR::Math::golden_section_search (FunctionType &function, const std::string &message, ValueType min_bound, ValueType init_estimate, ValueType max_bound, ValueType tolerance=0.01)
 Computes the minimum of a 1D function using a golden section search. More...
 

Detailed Description

Function Documentation

◆ golden_section_search()

template<class FunctionType , typename ValueType >
ValueType MR::Math::golden_section_search ( FunctionType &  function,
const std::string &  message,
ValueType  min_bound,
ValueType  init_estimate,
ValueType  max_bound,
ValueType  tolerance = 0.01 
)

Computes the minimum of a 1D function using a golden section search.

This function operates on a cost function class that must define a operator() method. The method must take a single ValueType argument x and return the cost of the function at x.

The min_bound and max_bound arguments define values that bracket the expected minimum. The estimate argument is the initial estimate of the minimum that is required to be larger than min_bound and smaller than max_bound.

Typical usage:

CostFunction cost_function();
float optimal_value = Math::golden_section_search(cost_function, "optimising", min_bound, initial_estimate , max_bound);
ValueType golden_section_search(FunctionType &function, const std::string &message, ValueType min_bound, ValueType init_estimate, ValueType max_bound, ValueType tolerance=0.01)
Computes the minimum of a 1D function using a golden section search.

Definition at line 50 of file golden_section_search.h.