Logo ROOT   6.19/01
Reference Guide
ROOT::Math::GSLRootFinder Class Reference

Base class for GSL Root-Finding algorithms for one dimensional functions which do not use function derivatives.

For finding the roots users should not use this class directly but instantiate the derived classes, for example ROOT::Math::Roots::Brent for using the Brent algorithm. All the classes defining the alhorithms are defined in the header Math/RootFinderAlgorithm.h They possible types implementing root bracketing algorithms which they do not require function derivatives are:

See also the specific classes for the documentation. See the GSL online manual for information on the GSL Root-Finding algorithms

Definition at line 73 of file GSLRootFinder.h.

Public Types

typedef double(* GSLFuncPointer) (double, void *)
 

Public Member Functions

 GSLRootFinder ()
 
virtual ~GSLRootFinder ()
 
int Iterate ()
 This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return an error if it's not one of them. More...
 
int Iterations () const
 Return number of iterations. More...
 
const char * Name () const
 
double GSLRootFinder::XLower() const { return fXlow; } More...
 
double Root () const
 Returns the previously calculated root. More...
 
bool SetFunction (const IGenFunction &f, double xlow, double xup)
 Sets the function for the rest of the algorithms. More...
 
bool SetFunction (GSLFuncPointer f, void *params, double xlow, double xup)
 
virtual bool SetFunction (const ROOT::Math::IGenFunction &, double, double)
 Sets the function for the rest of the algorithms. More...
 
virtual bool SetFunction (const ROOT::Math::IGradFunction &, double)
 Sets the function for algorithms using derivatives. More...
 
bool Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10)
 Find the root. More...
 
int Status () const
 Return the status of last root finding. More...
 
- Public Member Functions inherited from ROOT::Math::IRootFinderMethod
 IRootFinderMethod ()
 Default Constructor. More...
 
virtual ~IRootFinderMethod ()
 Default Destructor. More...
 
virtual bool SetFunction (const ROOT::Math::IGradFunction &, double)
 Sets the function for algorithms using derivatives. More...
 

Protected Member Functions

void FreeSolver ()
 
void SetSolver (GSLRootFSolver *s)
 

Private Member Functions

 GSLRootFinder (const GSLRootFinder &)
 
GSLRootFinderoperator= (const GSLRootFinder &)
 

Private Attributes

GSLFunctionWrapperfFunction
 
int fIter
 
double fRoot
 
GSLRootFSolverfS
 
int fStatus
 
bool fValidInterval
 
double fXlow
 
double fXup
 

#include <Math/GSLRootFinder.h>

Inheritance diagram for ROOT::Math::GSLRootFinder:
[legend]

Member Typedef Documentation

◆ GSLFuncPointer

typedef double( * ROOT::Math::GSLRootFinder::GSLFuncPointer) (double, void *)

Definition at line 96 of file GSLRootFinder.h.

Constructor & Destructor Documentation

◆ GSLRootFinder() [1/2]

ROOT::Math::GSLRootFinder::GSLRootFinder ( )

Definition at line 49 of file GSLRootFinder.cxx.

◆ ~GSLRootFinder()

ROOT::Math::GSLRootFinder::~GSLRootFinder ( )
virtual

Definition at line 59 of file GSLRootFinder.cxx.

◆ GSLRootFinder() [2/2]

ROOT::Math::GSLRootFinder::GSLRootFinder ( const GSLRootFinder )
private

Definition at line 65 of file GSLRootFinder.cxx.

Member Function Documentation

◆ FreeSolver()

void ROOT::Math::GSLRootFinder::FreeSolver ( )
protected

Definition at line 113 of file GSLRootFinder.cxx.

◆ Iterate()

int ROOT::Math::GSLRootFinder::Iterate ( )
virtual

This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return an error if it's not one of them.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 118 of file GSLRootFinder.cxx.

◆ Iterations()

int ROOT::Math::GSLRootFinder::Iterations ( ) const
inlinevirtual

Return number of iterations.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 114 of file GSLRootFinder.h.

◆ Name()

const char * ROOT::Math::GSLRootFinder::Name ( ) const
virtual


double GSLRootFinder::XLower() const { return fXlow; }

double GSLRootFinder::XUpper() const { return fXup; }

Implements ROOT::Math::IRootFinderMethod.

Definition at line 159 of file GSLRootFinder.cxx.

◆ operator=()

GSLRootFinder & ROOT::Math::GSLRootFinder::operator= ( const GSLRootFinder rhs)
private

Definition at line 69 of file GSLRootFinder.cxx.

◆ Root()

double ROOT::Math::GSLRootFinder::Root ( ) const
virtual

Returns the previously calculated root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 146 of file GSLRootFinder.cxx.

◆ SetFunction() [1/4]

bool ROOT::Math::GSLRootFinder::SetFunction ( const IGenFunction ,
double  ,
double   
)
virtual

Sets the function for the rest of the algorithms.

The parameters set the interval where the root has to be calculated.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 93 of file GSLRootFinder.cxx.

◆ SetFunction() [2/4]

bool ROOT::Math::GSLRootFinder::SetFunction ( GSLFuncPointer  f,
void params,
double  xlow,
double  xup 
)

Definition at line 77 of file GSLRootFinder.cxx.

◆ SetFunction() [3/4]

virtual bool ROOT::Math::IRootFinderMethod::SetFunction
inline

Sets the function for the rest of the algorithms.

The parameters set the interval where the root has to be calculated.

Definition at line 53 of file IRootFinderMethod.h.

◆ SetFunction() [4/4]

virtual bool ROOT::Math::IRootFinderMethod::SetFunction
inline

Sets the function for algorithms using derivatives.

Definition at line 45 of file IRootFinderMethod.h.

◆ SetSolver()

void ROOT::Math::GSLRootFinder::SetSolver ( GSLRootFSolver s)
protected

Definition at line 108 of file GSLRootFinder.cxx.

◆ Solve()

bool ROOT::Math::GSLRootFinder::Solve ( int  maxIter = 100,
double  absTol = 1E-8,
double  relTol = 1E-10 
)
virtual

Find the root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 164 of file GSLRootFinder.cxx.

◆ Status()

int ROOT::Math::GSLRootFinder::Status ( ) const
inlinevirtual

Return the status of last root finding.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 119 of file GSLRootFinder.h.

Member Data Documentation

◆ fFunction

GSLFunctionWrapper* ROOT::Math::GSLRootFinder::fFunction
private

Definition at line 133 of file GSLRootFinder.h.

◆ fIter

int ROOT::Math::GSLRootFinder::fIter
private

Definition at line 139 of file GSLRootFinder.h.

◆ fRoot

double ROOT::Math::GSLRootFinder::fRoot
private

Definition at line 136 of file GSLRootFinder.h.

◆ fS

GSLRootFSolver* ROOT::Math::GSLRootFinder::fS
private

Definition at line 134 of file GSLRootFinder.h.

◆ fStatus

int ROOT::Math::GSLRootFinder::fStatus
private

Definition at line 140 of file GSLRootFinder.h.

◆ fValidInterval

bool ROOT::Math::GSLRootFinder::fValidInterval
private

Definition at line 141 of file GSLRootFinder.h.

◆ fXlow

double ROOT::Math::GSLRootFinder::fXlow
private

Definition at line 137 of file GSLRootFinder.h.

◆ fXup

double ROOT::Math::GSLRootFinder::fXup
private

Definition at line 138 of file GSLRootFinder.h.

Libraries for ROOT::Math::GSLRootFinder:
[legend]

The documentation for this class was generated from the following files: