class ROOT::Math::RootFinder


         Class to find the Root of one dimensional functions.
         The class is templated on the type of Root solver algorithms.
         The possible types of Root-finding algorithms are:
         <ul>
         <li>Root Bracketing Algorithms which they do not require function derivatives
         <ol>
         <li>Roots::Bisection
         <li>Roots::FalsePos
         <li>Roots::Brent
         </ol>
         <li>Root Finding Algorithms using Derivatives
         <ol>
         <li>Roots::Newton
         <li>Roots::Secant
         <li>Roots::Steffenson
         </ol>
         </ul>

         This class does not cupport copying

         @ingroup RootFinders


Function Members (Methods)

public:
virtual~RootFinder()
intIterate()
intIterations() const
const char*Name() const
doubleRoot() const
ROOT::Math::RootFinderRootFinder(ROOT::Math::RootFinder::EType type = RootFinder::kBRENT)
intSetFunction(const ROOT::Math::IGradFunction& f, double xstart)
intSetFunction(const ROOT::Math::IGenFunction& f, double xlow, double xup)
intSetMethod(ROOT::Math::RootFinder::EType type = RootFinder::kBRENT)
intSolve(int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6)
private:
ROOT::Math::RootFinder&operator=(const ROOT::Math::RootFinder& rhs)
ROOT::Math::RootFinderRootFinder(const ROOT::Math::RootFinder&)

Data Members

public:
enum EType { kBRENT
kGSL_BISECTION
kGSL_FALSE_POS
kGSL_BRENT
kGSL_NEWTON
kGSL_SECANT
kGSL_STEFFENSON
};
private:
ROOT::Math::IRootFinderMethod*fSolvertype of algorithm to be used

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

RootFinder(RootFinder::EType type = RootFinder::kBRENT)
            Construct a Root-Finder algorithm

virtual ~RootFinder()
RootFinder(const RootFinder & )
 usually copying is non trivial, so we make this unaccessible
{}
int SetMethod(ROOT::Math::RootFinder::EType type = RootFinder::kBRENT)
int SetFunction(const ROOT::Math::IGenFunction& f, double xlow, double xup)
            Provide to the solver the function and the initial search interval [xlow, xup]
            for algorithms not using derivatives (bracketing algorithms)
            The templated function f must be of a type implementing the \a operator() method,
            <em>  double  operator() (  double  x ) </em>
            Returns non zero if interval is not valid (i.e. does not contains a root)

return fSolver-> SetFunction(const ROOT::Math::IGenFunction& f, double xlow, double xup)
int Solve(int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6)
             Compute the roots iterating until the estimate of the Root is within the required tolerance returning
             the iteration Status

int Iterations()
             Return the number of iteration performed to find the Root.

int Iterate()
            Perform a single iteration and return the Status

double Root()
            Return the current and latest estimate of the Root

const char * Name()
            Return the current and latest estimate of the lower value of the Root-finding interval (for bracketing algorithms)

double XLower() const {
return fSolver->XLower();
}

            Return the current and latest estimate of the upper value of the Root-finding interval (for bracketing algorithms)

double XUpper() const {
return  fSolver->XUpper();
}

            Get Name of the Root-finding solver algorithm


Last change: root/mathmore:$Id: RootFinder.h 24477 2008-06-23 12:58:47Z moneta $
Last generated: 2008-06-25 08:30
Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.