ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BrentMethods.h
Go to the documentation of this file.
1 #ifndef ROOT_Math_BrentMethods
2 #define ROOT_Math_BrentMethods
3 
4 #ifndef ROOT_Math_IFunctionfwd
5 #include "Math/IFunctionfwd.h"
6 #endif
7 
8 
9 namespace ROOT {
10 namespace Math {
11 
12 namespace BrentMethods {
13 
14 /**
15  Grid search implementation, used to bracket the minimum and later
16  use Brent's method with the bracketed interval
17  The step of the search is set to (xmax-xmin)/fNpx
18  type: 0-returns MinimumX
19  1-returns Minimum
20  2-returns MaximumX
21  3-returns Maximum
22  4-returns X corresponding to fy
23 
24 */
25 
26  double MinimStep(const IGenFunction* f, int type, double &xmin, double &xmax, double fy, int npx = 100, bool useLog = false);
27 
28  /**
29  Finds a minimum of a function, if the function is unimodal between xmin and xmax
30  This method uses a combination of golden section search and parabolic interpolation
31  Details about convergence and properties of this algorithm can be
32  found in the book by R.P.Brent "Algorithms for Minimization Without Derivatives"
33  or in the "Numerical Recipes", chapter 10.2
34  convergence is reached using tolerance = 2 *( epsrel * abs(x) + epsabs)
35 
36  type: 0-returns MinimumX
37  1-returns Minimum
38  2-returns MaximumX
39  3-returns Maximum
40  4-returns X corresponding to fy
41 
42  if ok=true the method has converged.
43  Maxiter returns the actual number of iteration performed
44 
45  */
46 
47  double MinimBrent(const IGenFunction* f, int type, double &xmin, double &xmax, double xmiddle, double fy, bool &ok, int &niter, double epsabs = 1.E-8, double epsrel = 1.E-10, int maxiter = 100 );
48 
49 
50 } // end namespace BrentMethods
51 } // end namespace Math
52 } // ned namespace ROOT
53 
54 #endif
float xmin
Definition: THbookFile.cxx:93
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition: IFunction.h:133
double MinimStep(const IGenFunction *f, int type, double &xmin, double &xmax, double fy, int npx=100, bool useLog=false)
Grid search implementation, used to bracket the minimum and later use Brent's method with the bracket...
double MinimBrent(const IGenFunction *f, int type, double &xmin, double &xmax, double xmiddle, double fy, bool &ok, int &niter, double epsabs=1.E-8, double epsrel=1.E-10, int maxiter=100)
Finds a minimum of a function, if the function is unimodal between xmin and xmax This method uses a c...
TFile * f
Double_t E()
Definition: TMath.h:54
float xmax
Definition: THbookFile.cxx:93
int type
Definition: TGX11.cxx:120