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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
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...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.