ROOT logo
ROOT » MATH » MATHCORE » ROOT::Math::BrentRootFinder

class ROOT::Math::BrentRootFinder: public ROOT::Math::IRootFinderMethod


   User class for finding function roots.

   It will use the Brent Method for finding function roots in a given interval.
   This class is implemented from TF1::GetX() method.

   @ingroup RootFinders


Function Members (Methods)

public:
virtual~BrentRootFinder()
ROOT::Math::BrentRootFinderBrentRootFinder()
ROOT::Math::BrentRootFinderBrentRootFinder(const ROOT::Math::BrentRootFinder&)
virtual intROOT::Math::IRootFinderMethod::Iterate()
virtual intROOT::Math::IRootFinderMethod::Iterations() const
virtual const char*Name() const
ROOT::Math::IRootFinderMethod&ROOT::Math::IRootFinderMethod::operator=(const ROOT::Math::IRootFinderMethod&)
virtual doubleRoot() const
virtual intSetFunction(const ROOT::Math::IGenFunction& f, double xlow, double xup)
virtual intSolve(int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6)

Data Members

protected:
const ROOT::Math::IGenFunction*fFunctionPointer to the function.
doublefRootCurrent stimation of the function root.
doublefXMaxUpper bound of the search interval
doublefXMinLower bound of the search interval.

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

virtual ~BrentRootFinder()
 Default Destructor. 
BrentRootFinder()
 Default Constructor. 
int SetFunction(const ROOT::Math::IGenFunction& f, double xlow, double xup)
int Solve(int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6)
 Returns the X value corresponding to the function value fy for (xmin<x<xmax).
          Method:
          First, the grid search is used to bracket the maximum
          with the step size = (xmax-xmin)/fNpx. This way, the step size
          can be controlled via the SetNpx() function. 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.

          \@param maxIter maximum number of iterations.
          \@param absTol desired absolute error in the minimum position.
          \@param absTol desired relative error in the minimum position.

double Root() const
 Returns root value. Need to call first Solve(). 
const char* Name() const
 Return name of root finder algorithm ("BrentRootFinder").