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