ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::GSLRootFinderDeriv Class Reference

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

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

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

Definition at line 82 of file GSLRootFinderDeriv.h.

Public Types

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

Public Member Functions

 GSLRootFinderDeriv ()
 
virtual ~GSLRootFinderDeriv ()
 
bool SetFunction (const IGradFunction &f, double xstart)
 Sets the function for algorithms using derivatives. More...
 
bool SetFunction (GSLFuncPointer f, GSLFuncPointer df, GSLFdFPointer fdf, void *p, double Root)
 
int Iterate ()
 iterate (return GSL_SUCCESS in case of successful iteration) More...
 
double Root () const
 Returns the previously calculated root. More...
 
bool Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10)
 Find the root (return false if failed) More...
 
int Iterations () const
 Return number of iterations. More...
 
int Status () const
 Return the status of last root finding. More...
 
const char * Name () const
 Return name of root finder algorithm. More...
 
- Public Member Functions inherited from ROOT::Math::IRootFinderMethod
virtual ~IRootFinderMethod ()
 Default Destructor. More...
 
 IRootFinderMethod ()
 Default Constructor. More...
 
virtual bool SetFunction (const ROOT::Math::IGenFunction &, double, double)
 Sets the function for the rest of the algorithms. More...
 

Protected Member Functions

void SetSolver (GSLRootFdFSolver *s)
 
void FreeSolver ()
 

Private Member Functions

 GSLRootFinderDeriv (const GSLRootFinderDeriv &)
 
GSLRootFinderDerivoperator= (const GSLRootFinderDeriv &)
 

Private Attributes

GSLFunctionDerivWrapperfFunction
 
GSLRootFdFSolverfS
 
double fRoot
 
double fPrevRoot
 
int fIter
 
int fStatus
 
bool fValidPoint
 

#include <Math/GSLRootFinderDeriv.h>

+ Inheritance diagram for ROOT::Math::GSLRootFinderDeriv:
+ Collaboration diagram for ROOT::Math::GSLRootFinderDeriv:

Member Typedef Documentation

typedef void( * ROOT::Math::GSLRootFinderDeriv::GSLFdFPointer) (double, void *, double *, double *)

Definition at line 111 of file GSLRootFinderDeriv.h.

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

Definition at line 110 of file GSLRootFinderDeriv.h.

Constructor & Destructor Documentation

ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv ( )

Definition at line 49 of file GSLRootFinderDeriv.cxx.

ROOT::Math::GSLRootFinderDeriv::~GSLRootFinderDeriv ( )
virtual

Definition at line 59 of file GSLRootFinderDeriv.cxx.

ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv ( const GSLRootFinderDeriv )
private

Definition at line 65 of file GSLRootFinderDeriv.cxx.

Member Function Documentation

void ROOT::Math::GSLRootFinderDeriv::FreeSolver ( )
protected
int ROOT::Math::GSLRootFinderDeriv::Iterate ( )
virtual

iterate (return GSL_SUCCESS in case of successful iteration)

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 108 of file GSLRootFinderDeriv.cxx.

Referenced by Solve().

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

Return number of iterations.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 125 of file GSLRootFinderDeriv.h.

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

Return name of root finder algorithm.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 133 of file GSLRootFinderDeriv.cxx.

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

Definition at line 69 of file GSLRootFinderDeriv.cxx.

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

Returns the previously calculated root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 128 of file GSLRootFinderDeriv.cxx.

bool ROOT::Math::GSLRootFinderDeriv::SetFunction ( const IGradFunction ,
double   
)
inlinevirtual

Sets the function for algorithms using derivatives.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 104 of file GSLRootFinderDeriv.h.

Referenced by testGSLRootFinder().

bool ROOT::Math::GSLRootFinderDeriv::SetFunction ( GSLFuncPointer  f,
GSLFuncPointer  df,
GSLFdFPointer  fdf,
void p,
double  Root 
)

Definition at line 80 of file GSLRootFinderDeriv.cxx.

void ROOT::Math::GSLRootFinderDeriv::SetSolver ( GSLRootFdFSolver s)
protected
bool ROOT::Math::GSLRootFinderDeriv::Solve ( int  maxIter = 100,
double  absTol = 1E-8,
double  relTol = 1E-10 
)
virtual

Find the root (return false if failed)

Implements ROOT::Math::IRootFinderMethod.

Definition at line 138 of file GSLRootFinderDeriv.cxx.

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

Return the status of last root finding.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 130 of file GSLRootFinderDeriv.h.

Member Data Documentation

GSLFunctionDerivWrapper* ROOT::Math::GSLRootFinderDeriv::fFunction
private
int ROOT::Math::GSLRootFinderDeriv::fIter
private

Definition at line 147 of file GSLRootFinderDeriv.h.

Referenced by Iterations(), and Solve().

double ROOT::Math::GSLRootFinderDeriv::fPrevRoot
mutableprivate

Definition at line 146 of file GSLRootFinderDeriv.h.

Referenced by Iterate(), and Solve().

double ROOT::Math::GSLRootFinderDeriv::fRoot
mutableprivate

Definition at line 145 of file GSLRootFinderDeriv.h.

Referenced by Iterate(), Root(), SetFunction(), and Solve().

GSLRootFdFSolver* ROOT::Math::GSLRootFinderDeriv::fS
private

Definition at line 143 of file GSLRootFinderDeriv.h.

Referenced by FreeSolver(), Iterate(), Name(), SetFunction(), and SetSolver().

int ROOT::Math::GSLRootFinderDeriv::fStatus
private

Definition at line 148 of file GSLRootFinderDeriv.h.

Referenced by SetFunction(), Solve(), and Status().

bool ROOT::Math::GSLRootFinderDeriv::fValidPoint
private

Definition at line 149 of file GSLRootFinderDeriv.h.

Referenced by Iterate(), and SetFunction().


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