DiFfRG
|
Minimizer using the Nelder-Mead simplex algorithm from GSL. More...
#include <minimization.hh>
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. | |
![]() | |
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 Attributes | |
std::array< double, dim > | x0 |
double | step_size |
![]() | |
FUN | f |
double | abs_tol |
uint | max_iter |
uint | iter |
Private Types | |
using | FUN = AbstractMinimizer<dim>::FUN |
Additional Inherited Members | |
![]() | |
using | FUN = std::function<double(const std::array<double, dim> &)> |
Minimizer using the Nelder-Mead simplex algorithm from GSL.
dim | Dimension of the minimization problem. |
|
private |
|
inline |
Construct a new GSLSimplexMinimizer object.
f | Objective function to minimize. Must take a std::array<double, dim> as input and return a double. |
abs_tol | Absolute tolerance for the minimization. |
max_iter | Maximum number of iterations. |
|
inlinestatic |
|
inlineoverrideprotectedvirtual |
Implements DiFfRG::AbstractMinimizer< dim >.
|
inline |
Set the initial step size for the minimization.
step_size | Initial step size. |
|
inline |
Set the initial guess for the minimization.
x0 | Initial guess. |
|
protected |
|
protected |