yat  0.20.3pre
Classes | Public Member Functions | Protected Member Functions | List of all members
theplu::yat::utility::Minimizer Class Reference

Wrapper class around gsl_min_fminimizer in GSL. More...

#include <yat/utility/Minimizer.h>

Inheritance diagram for theplu::yat::utility::Minimizer:
theplu::yat::utility::BrentMinimizer theplu::yat::utility::GoldenSection theplu::yat::utility::QuadGolden

Classes

class  Interval
 
class  Stopper
 

Public Member Functions

 Minimizer (const Minimizer &)=delete
 Copy is not allowed.
 
Minimizeroperator= (const Minimizer &)=delete
 Assignment is not allowed.
 
unsigned int epochs (void) const
 Number of epochs (iterations) used in last minimisation.
 
template<class FUNC >
double operator() (FUNC &func, double guess, double min, double max, Stopper &&stopper)
 
template<class FUNC >
double operator() (FUNC &func, double guess, double min, double max, Stopper &&stopper, unsigned int max_epochs)
 

Protected Member Functions

 Minimizer (const gsl_min_fminimizer_type *t)
 Constructor. More...
 

Detailed Description

Wrapper class around gsl_min_fminimizer in GSL.

Class is the abstract base class for several minimisation algorithms.

Since
New in yat 0.20

Constructor & Destructor Documentation

◆ Minimizer()

theplu::yat::utility::Minimizer::Minimizer ( const gsl_min_fminimizer_type *  t)
protected

Constructor.

Parameters
tdefines type of GSL minimizer

Member Function Documentation

◆ operator()() [1/2]

template<class FUNC >
double theplu::yat::utility::Minimizer::operator() ( FUNC &  func,
double  guess,
double  min,
double  max,
Minimizer::Stopper &&  stopper 
)

Function finds an x that minimizes the function defined by func. It calls gsl_min_fminimizer_iterate until there is no progress as defined by stopper.

Type Requirements:

  • FUNC must have an operator double operator()(double x)

◆ operator()() [2/2]

template<class FUNC >
double theplu::yat::utility::Minimizer::operator() ( FUNC &  func,
double  guess,
double  min,
double  max,
Minimizer::Stopper &&  stopper,
unsigned int  max_epochs 
)

Same as operator()(FUNC& func, double guess, double min, double max, Stopper&& stopper); but run at maximum max_epochs epochs (iterations). It is the responsibility of the caller to check if maximum number of epochs has been reached, for example, with the epochs(void function.


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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14