User class for performing function minimization.
It will use the Brent Method for function minimization in a given interval. First, a grid search is used to bracket the minimum value with the a step size = (xmax-xmin)/npx. The step size can be controlled via the SetNpx() function. A default value of npx = 100 is used. The default value con be changed using the static method SetDefaultNpx. If the function is unimodal or if its extrema are far apart, setting the fNpx to a small value speeds the algorithm up many times. Then, Brent's method is applied on the bracketed interval. If the Brent method fails to converge the bracketing is repeted on the latest best estimate of the interval. The procedure is repeted with a maximum value (default =10) which can be set for all BrentRootFinder classes with the method SetDefaultNSearch
This class is implemented from TF1::GetMinimum.
To use the class, three steps have to be taken:
- Create the class.
- Set a function within an interval to look for the minimum.
- Call the Minimize function with the error parameters.
If another minimization is to be performed, repeat the last two steps.
Definition at line 73 of file BrentMinimizer1D.h.
bool ROOT::Math::BrentMinimizer1D::Minimize |
( |
int |
maxIter, |
|
|
double |
absTol = 1.E-8 , |
|
|
double |
relTol = 1.E-10 |
|
) |
| |
|
virtual |
Find minimum position iterating until convergence specified by the absolute and relative tolerance or the maximum number of iteration is reached.
Return true if iterations converged successfully @param maxIter maximum number of iterations. @param absTol desired absolute error in the minimum position (default 1.E-8) @param absTol desired relative error in the minimum position (default = 1.E-10)
Implements ROOT::Math::IMinimizer1D.
Definition at line 87 of file BrentMinimizer1D.cxx.