ROOT
6.07/01
Reference Guide
|
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, whic 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 (Minim1D::Type type=Minim1D::kBRENT) | |
Construct the minimizer passing the minimizer type using the Minim1D::Algorithm enumeration. More... | |
virtual | ~GSLMinimizer1D () |
Destructor: free allocated resources. More... | |
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. More... | |
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. More... | |
int | Iterate () |
Perform a minimizer iteration and if an unexepcted problem occurr then an error code will be returned. More... | |
double | XMinimum () const |
Return current estimate of the position of the minimum. More... | |
double | XLower () const |
Return current lower bound of the minimization interval. More... | |
double | XUpper () const |
Return current upper bound of the minimization interval. More... | |
double | FValMinimum () const |
Return function value at current estimate of the minimum. More... | |
double | FValLower () const |
Return function value at current lower bound of the minimization interval. More... | |
double | FValUpper () const |
Return function value at current upper bound of the minimization interval. More... | |
bool | Minimize (int maxIter, double absTol, double relTol) |
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 successfull @param maxIter maximum number of iteration @param absTol desired absolute error in the minimum position @param absTol desired relative error in the minimum position. More... | |
int | Iterations () const |
Return number of iteration used to find minimum. More... | |
int | Status () const |
Return status of last minimization. More... | |
const char * | Name () const |
Return name of minimization algorithm. More... | |
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. More... | |
Private Member Functions | |
GSLMinimizer1D (const GSLMinimizer1D &) | |
GSLMinimizer1D & | operator= (const GSLMinimizer1D &) |
Private Attributes | |
double | fXmin |
double | fXlow |
double | fXup |
double | fMin |
double | fLow |
double | fUp |
int | fIter |
int | fStatus |
bool | fIsSet |
GSL1DMinimizerWrapper * | fMinimizer |
GSLFunctionWrapper * | fFunction |
#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.
|
virtual |
Destructor: free allocated resources.
Definition at line 78 of file GSLMinimizer1D.cxx.
|
private |
Definition at line 86 of file GSLMinimizer1D.cxx.
|
virtual |
Return function value at current lower bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 161 of file GSLMinimizer1D.cxx.
|
virtual |
Return function value at current estimate of the minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 156 of file GSLMinimizer1D.cxx.
Referenced by testMinimization1D().
|
virtual |
Return function value at current upper bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 166 of file GSLMinimizer1D.cxx.
int ROOT::Math::GSLMinimizer1D::Iterate | ( | ) |
Perform a minimizer iteration and if an unexepcted problem occurr then an error code will be returned.
Definition at line 122 of file GSLMinimizer1D.cxx.
Referenced by Minimize().
|
inlinevirtual |
Return number of iteration used to find minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 174 of file GSLMinimizer1D.h.
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 successfull @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 176 of file GSLMinimizer1D.cxx.
Referenced by testMinimization1D().
|
virtual |
Return name of minimization algorithm.
Implements ROOT::Math::IMinimizer1D.
Definition at line 171 of file GSLMinimizer1D.cxx.
Referenced by testMinimization1D().
|
private |
Definition at line 91 of file GSLMinimizer1D.cxx.
|
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 109 of file GSLMinimizer1D.h.
Referenced by testMinimization1D().
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 98 of file GSLMinimizer1D.cxx.
|
inlinevirtual |
Return status of last minimization.
Implements ROOT::Math::IMinimizer1D.
Definition at line 181 of file GSLMinimizer1D.h.
Referenced by testMinimization1D().
|
static |
Test convergence of the interval.
The test returns success if
\[ |x_{min}-x_{truemin}| < epsAbs + epsRel *x_{truemin} \]
Definition at line 214 of file GSLMinimizer1D.cxx.
Referenced by Minimize().
|
virtual |
Return current lower bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 146 of file GSLMinimizer1D.cxx.
|
virtual |
Return current estimate of the position of the minimum.
Implements ROOT::Math::IMinimizer1D.
Definition at line 141 of file GSLMinimizer1D.cxx.
Referenced by testMinimization1D().
|
virtual |
Return current upper bound of the minimization interval.
Implements ROOT::Math::IMinimizer1D.
Definition at line 151 of file GSLMinimizer1D.cxx.
|
private |
Definition at line 215 of file GSLMinimizer1D.h.
Referenced by GSLMinimizer1D(), SetFunction(), and ~GSLMinimizer1D().
|
private |
Definition at line 211 of file GSLMinimizer1D.h.
Referenced by Iterate(), and SetFunction().
|
private |
Definition at line 209 of file GSLMinimizer1D.h.
Referenced by Iterations(), and Minimize().
|
private |
Definition at line 207 of file GSLMinimizer1D.h.
Referenced by FValLower(), Iterate(), and Minimize().
|
private |
Definition at line 206 of file GSLMinimizer1D.h.
Referenced by FValMinimum(), Iterate(), and Minimize().
|
private |
Definition at line 214 of file GSLMinimizer1D.h.
Referenced by GSLMinimizer1D(), Iterate(), Name(), SetFunction(), and ~GSLMinimizer1D().
|
private |
Definition at line 210 of file GSLMinimizer1D.h.
Referenced by Minimize(), SetFunction(), and Status().
|
private |
Definition at line 208 of file GSLMinimizer1D.h.
Referenced by FValUpper(), Iterate(), and Minimize().
|
private |
Definition at line 204 of file GSLMinimizer1D.h.
Referenced by Iterate(), Minimize(), SetFunction(), and XLower().
|
private |
Definition at line 203 of file GSLMinimizer1D.h.
Referenced by Iterate(), Minimize(), SetFunction(), and XMinimum().
|
private |
Definition at line 205 of file GSLMinimizer1D.h.
Referenced by Iterate(), Minimize(), SetFunction(), and XUpper().