Minimizer for arbitrary one dimensional functions.
Implemented using GSL, for detailed description see: GSL online doc
The algorithms uspported are only bracketing algorithm which do not use derivatives information. The algorithms which can be chosen at construction time are GOLDENSECTION, which is the simplest method but the slowest and BRENT (the default one) which combines the golden section with a parabolic interpolation.
This class does not support copying
Definition at line 81 of file GSLMinimizer1D.h.
Public Member Functions | |
GSLMinimizer1D (const GSLMinimizer1D &)=delete | |
GSLMinimizer1D (GSLMinimizer1D &&)=delete | |
GSLMinimizer1D (Minim1D::Type type=Minim1D::kBRENT) | |
Construct the minimizer passing the minimizer type using the Minim1D::Algorithm enumeration. | |
~GSLMinimizer1D () override | |
Destructor: free allocated resources. | |
double | FValLower () const override |
Return function value at current lower bound of the minimization interval. | |
double | FValMinimum () const override |
Return function value at current estimate of the minimum. | |
double | FValUpper () const override |
Return function value at current upper bound of the minimization interval. | |
int | Iterate () |
Perform a minimizer iteration and if an unexpected problem occurs then an error code will be returned. | |
int | Iterations () const override |
Return number of iteration used to find minimum. | |
bool | Minimize (int maxIter, double absTol, double relTol) override |
Find minimum position iterating until convergence specified by the absolute and relative tolerance or the maximum number of iteration is reached Return true is result is successful @param maxIter maximum number of iteration @param absTol desired absolute error in the minimum position @param absTol desired relative error in the minimum position. | |
const char * | Name () const override |
Return name of minimization algorithm. | |
GSLMinimizer1D & | operator= (const GSLMinimizer1D &)=delete |
GSLMinimizer1D & | operator= (GSLMinimizer1D &&)=delete |
template<class UserFunc > | |
void | SetFunction (const UserFunc &f, double xmin, double xlow, double xup) |
Set, or reset, minimizer to use the function f and the initial search interval [xlow, xup], with a guess for the location of the minimum xmin. | |
void | SetFunction (GSLFuncPointer f, void *params, double xmin, double xlow, double xup) |
Set, or reset, minimizer to use the function f and the initial search interval [xlow, xup], with a guess for the location of the minimum xmin. | |
int | Status () const override |
Return status of last minimization. | |
double | XLower () const override |
Return current lower bound of the minimization interval. | |
double | XMinimum () const override |
Return current estimate of the position of the minimum. | |
double | XUpper () const override |
Return current upper bound of the minimization interval. | |
Public Member Functions inherited from ROOT::Math::IMinimizer1D | |
IMinimizer1D () | |
virtual | ~IMinimizer1D () |
Static Public Member Functions | |
static int | TestInterval (double xlow, double xup, double epsAbs, double epsRel) |
Test convergence of the interval. | |
Private Attributes | |
GSLFunctionWrapper * | fFunction |
bool | fIsSet |
int | fIter |
double | fLow |
double | fMin |
GSL1DMinimizerWrapper * | fMinimizer |
int | fStatus |
double | fUp |
double | fXlow |
double | fXmin |
double | fXup |
#include <Math/GSLMinimizer1D.h>
|
explicit |
Construct the minimizer passing the minimizer type using the Minim1D::Algorithm enumeration.
Definition at line 51 of file GSLMinimizer1D.cxx.
|
override |
Destructor: free allocated resources.
Definition at line 78 of file GSLMinimizer1D.cxx.
|
delete |
|
delete |
|
overridevirtual |
Return function value at current lower bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 149 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return function value at current estimate of the minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 144 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return function value at current upper bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 154 of file GSLMinimizer1D.cxx.
int ROOT::Math::GSLMinimizer1D::Iterate | ( | ) |
Perform a minimizer iteration and if an unexpected problem occurs then an error code will be returned.
Definition at line 110 of file GSLMinimizer1D.cxx.
|
inlineoverridevirtual |
Return number of iteration used to find minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 173 of file GSLMinimizer1D.h.
|
overridevirtual |
Find minimum position iterating until convergence specified by the absolute and relative tolerance or the maximum number of iteration is reached Return true is result is successful @param maxIter maximum number of iteration @param absTol desired absolute error in the minimum position @param absTol desired relative error in the minimum position.
Implements ROOT::Math::IMinimizer1D.
Definition at line 164 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return name of minimization algorithm.
Implements ROOT::Math::IMinimizer1D.
Definition at line 159 of file GSLMinimizer1D.cxx.
|
delete |
|
delete |
|
inline |
Set, or reset, minimizer to use the function f and the initial search interval [xlow, xup], with a guess for the location of the minimum xmin.
The condition : \( f(xlow) > f(xmin) < f(xup)\) must be satisfied
Definition at line 108 of file GSLMinimizer1D.h.
void ROOT::Math::GSLMinimizer1D::SetFunction | ( | GSLFuncPointer | f, |
void * | params, | ||
double | xmin, | ||
double | xlow, | ||
double | xup | ||
) |
Set, or reset, minimizer to use the function f and the initial search interval [xlow, xup], with a guess for the location of the minimum xmin.
The condition : \( f(xlow) > f(xmin) < f(xup) \) must be satisfied
Method specialized on the GSL function type
Definition at line 86 of file GSLMinimizer1D.cxx.
|
inlineoverridevirtual |
Return status of last minimization.
Implements ROOT::Math::IMinimizer1D.
Definition at line 180 of file GSLMinimizer1D.h.
|
static |
Test convergence of the interval.
The test returns success if
\[ |x_{min}-x_{truemin}| < epsAbs + epsRel *x_{truemin} \]
Definition at line 202 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return current lower bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 134 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return current estimate of the position of the minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 129 of file GSLMinimizer1D.cxx.
|
overridevirtual |
Return current upper bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 139 of file GSLMinimizer1D.cxx.
|
private |
Definition at line 214 of file GSLMinimizer1D.h.
|
private |
Definition at line 210 of file GSLMinimizer1D.h.
|
private |
Definition at line 208 of file GSLMinimizer1D.h.
|
private |
Definition at line 206 of file GSLMinimizer1D.h.
|
private |
Definition at line 205 of file GSLMinimizer1D.h.
|
private |
Definition at line 213 of file GSLMinimizer1D.h.
|
private |
Definition at line 209 of file GSLMinimizer1D.h.
|
private |
Definition at line 207 of file GSLMinimizer1D.h.
|
private |
Definition at line 203 of file GSLMinimizer1D.h.
|
private |
Definition at line 202 of file GSLMinimizer1D.h.
|
private |
Definition at line 204 of file GSLMinimizer1D.h.