Minimizer in 1D using either the golden section, Brent or quadratic method from GSL.
More...
#include <minimization.hh>
|
static double | gsl_wrap (double x, void *params) |
|
|
using | FUN = std::function<double(const double)> |
|
using | FUN_ARR = std::function<double(const std::array<double, 1> &)> |
|
Minimizer in 1D using either the golden section, Brent or quadratic method from GSL.
◆ FUN
◆ method
List of available minimization methods.
Enumerator |
---|
golden_section | |
brent | |
quadratic | |
◆ GSLMinimizer1D()
DiFfRG::GSLMinimizer1D::GSLMinimizer1D |
( |
const FUN & | f, |
|
|
const double | abs_tol = 1e-4, |
|
|
const int | max_iter = 1000 ) |
|
inline |
Construct a new GSLMinimizer1D object.
- Parameters
-
f | Objective function to minimize. Must take a std::array<double, 1> as input and return a double. |
abs_tol | Absolute tolerance for the minimization. |
max_iter | Maximum number of iterations. |
◆ gsl_wrap()
static double DiFfRG::GSLMinimizer1D::gsl_wrap |
( |
double | x, |
|
|
void * | params ) |
|
inlinestaticprotected |
◆ minimize_impl()
virtual std::array< double, 1 > DiFfRG::GSLMinimizer1D::minimize_impl |
( |
| ) |
|
|
inlineoverrideprotectedvirtual |
◆ set_bounds()
void DiFfRG::GSLMinimizer1D::set_bounds |
( |
const double | min_x, |
|
|
const double | max_x ) |
|
inline |
Set the bounds for the minimization.
- Parameters
-
min_x | Lower bound. |
max_x | Upper bound. |
◆ set_method()
void DiFfRG::GSLMinimizer1D::set_method |
( |
const method | m | ) |
|
|
inline |
Set the minimization method. Default is Brent.
- Parameters
-
◆ set_rel_tol()
void DiFfRG::GSLMinimizer1D::set_rel_tol |
( |
const double | rel_tol | ) |
|
|
inline |
Set the relative tolerance for the minimization. Default is 0.
- Parameters
-
rel_tol | Relative tolerance. |
◆ set_x0()
void DiFfRG::GSLMinimizer1D::set_x0 |
( |
const double | x0 | ) |
|
|
inline |
Set the initial guess for the minimization.
- Parameters
-
method DiFfRG::GSLMinimizer1D::m |
|
protected |
◆ max_x
double DiFfRG::GSLMinimizer1D::max_x |
|
protected |
◆ min_x
double DiFfRG::GSLMinimizer1D::min_x |
|
protected |
◆ rel_tol
double DiFfRG::GSLMinimizer1D::rel_tol |
|
protected |
◆ x0
double DiFfRG::GSLMinimizer1D::x0 |
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/common/minimization.hh