DiFfRG
Loading...
Searching...
No Matches
DiFfRG::GSLSimplexMinimizer< dim > Class Template Reference

Minimizer using the Nelder-Mead simplex algorithm from GSL. More...

#include <minimization.hh>

Inheritance diagram for DiFfRG::GSLSimplexMinimizer< dim >:
DiFfRG::AbstractMinimizer< dim >

Public Member Functions

 GSLSimplexMinimizer (const FUN &f, const double abs_tol=1e-4, const int max_iter=1000)
 Construct a new GSLSimplexMinimizer object.
 
void set_step_size (const double step_size)
 Set the initial step size for the minimization.
 
void set_x0 (const std::array< double, dim > &x0)
 Set the initial guess for the minimization.
 
- Public Member Functions inherited from DiFfRG::AbstractMinimizer< dim >
 AbstractMinimizer (const FUN &f, const double abs_tol=1e-4, const int max_iter=1000)
 Construct a new AbstractMinimizer object.
 
void set_abs_tol (const double abs_tol)
 Set the absolute tolerance for the minimization.
 
void set_max_iter (const uint max_iter)
 Set the maximum number of iterations.
 
uint get_iter () const
 Get the number of iterations used in the last minimization.
 
std::array< double, dim > minimize ()
 Perform the minimization.
 

Static Public Member Functions

static double gsl_wrap (const gsl_vector *v, void *params)
 

Protected Member Functions

virtual std::array< double, dim > minimize_impl () override
 
- Protected Member Functions inherited from DiFfRG::AbstractMinimizer< dim >

Protected Attributes

std::array< double, dim > x0
 
double step_size
 
- Protected Attributes inherited from DiFfRG::AbstractMinimizer< dim >
FUN f
 
double abs_tol
 
uint max_iter
 
uint iter
 

Private Types

using FUN = AbstractMinimizer<dim>::FUN
 

Additional Inherited Members

- Protected Types inherited from DiFfRG::AbstractMinimizer< dim >
using FUN = std::function<double(const std::array<double, dim> &)>
 

Detailed Description

template<int dim>
class DiFfRG::GSLSimplexMinimizer< dim >

Minimizer using the Nelder-Mead simplex algorithm from GSL.

Template Parameters
dimDimension of the minimization problem.

Member Typedef Documentation

◆ FUN

template<int dim>
using DiFfRG::GSLSimplexMinimizer< dim >::FUN = AbstractMinimizer<dim>::FUN
private

Constructor & Destructor Documentation

◆ GSLSimplexMinimizer()

template<int dim>
DiFfRG::GSLSimplexMinimizer< dim >::GSLSimplexMinimizer ( const FUN & f,
const double abs_tol = 1e-4,
const int max_iter = 1000 )
inline

Construct a new GSLSimplexMinimizer object.

Parameters
fObjective function to minimize. Must take a std::array<double, dim> as input and return a double.
abs_tolAbsolute tolerance for the minimization.
max_iterMaximum number of iterations.

Member Function Documentation

◆ gsl_wrap()

template<int dim>
static double DiFfRG::GSLSimplexMinimizer< dim >::gsl_wrap ( const gsl_vector * v,
void * params )
inlinestatic

◆ minimize_impl()

template<int dim>
virtual std::array< double, dim > DiFfRG::GSLSimplexMinimizer< dim >::minimize_impl ( )
inlineoverrideprotectedvirtual

◆ set_step_size()

template<int dim>
void DiFfRG::GSLSimplexMinimizer< dim >::set_step_size ( const double step_size)
inline

Set the initial step size for the minimization.

Parameters
step_sizeInitial step size.

◆ set_x0()

template<int dim>
void DiFfRG::GSLSimplexMinimizer< dim >::set_x0 ( const std::array< double, dim > & x0)
inline

Set the initial guess for the minimization.

Parameters
x0Initial guess.

Member Data Documentation

◆ step_size

template<int dim>
double DiFfRG::GSLSimplexMinimizer< dim >::step_size
protected

◆ x0

template<int dim>
std::array<double, dim> DiFfRG::GSLSimplexMinimizer< dim >::x0
protected

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