Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 74 of file GSLRootFinderDeriv.h.

Public Types

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

Public Member Functions

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

Protected Member Functions

void FreeSolver ()
 
void SetSolver (GSLRootFdFSolver *s)
 

Private Attributes

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

#include <Math/GSLRootFinderDeriv.h>

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

Member Typedef Documentation

◆ GSLFdFPointer

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

Definition at line 100 of file GSLRootFinderDeriv.h.

◆ GSLFuncPointer

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

Definition at line 99 of file GSLRootFinderDeriv.h.

Constructor & Destructor Documentation

◆ GSLRootFinderDeriv() [1/3]

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

Definition at line 48 of file GSLRootFinderDeriv.cxx.

◆ ~GSLRootFinderDeriv()

ROOT::Math::GSLRootFinderDeriv::~GSLRootFinderDeriv ( )
override

Definition at line 58 of file GSLRootFinderDeriv.cxx.

◆ GSLRootFinderDeriv() [2/3]

ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv ( const GSLRootFinderDeriv )
delete

◆ GSLRootFinderDeriv() [3/3]

ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv ( GSLRootFinderDeriv &&  )
delete

Member Function Documentation

◆ FreeSolver()

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

Definition at line 88 of file GSLRootFinderDeriv.cxx.

◆ Iterate()

int ROOT::Math::GSLRootFinderDeriv::Iterate ( )
overridevirtual

iterate (return GSL_SUCCESS in case of successful iteration)

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 93 of file GSLRootFinderDeriv.cxx.

◆ Iterations()

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

Return number of iterations.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 114 of file GSLRootFinderDeriv.h.

◆ Name()

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

Return name of root finder algorithm.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 118 of file GSLRootFinderDeriv.cxx.

◆ operator=() [1/2]

GSLRootFinderDeriv & ROOT::Math::GSLRootFinderDeriv::operator= ( const GSLRootFinderDeriv )
delete

◆ operator=() [2/2]

GSLRootFinderDeriv & ROOT::Math::GSLRootFinderDeriv::operator= ( GSLRootFinderDeriv &&  )
delete

◆ Root()

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

Returns the previously calculated root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 113 of file GSLRootFinderDeriv.cxx.

◆ SetFunction() [1/4]

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

Sets the function for algorithms using derivatives.


Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 93 of file GSLRootFinderDeriv.h.

◆ SetFunction() [2/4]

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

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 53 of file IRootFinderMethod.h.

◆ SetFunction() [3/4]

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

Sets the function for algorithms using derivatives.


Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 45 of file IRootFinderMethod.h.

◆ SetFunction() [4/4]

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

Definition at line 65 of file GSLRootFinderDeriv.cxx.

◆ SetSolver()

void ROOT::Math::GSLRootFinderDeriv::SetSolver ( GSLRootFdFSolver s)
protected

Definition at line 83 of file GSLRootFinderDeriv.cxx.

◆ Solve()

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

Find the root (return false if failed)

Implements ROOT::Math::IRootFinderMethod.

Definition at line 123 of file GSLRootFinderDeriv.cxx.

◆ Status()

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

Return the status of last root finding.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 119 of file GSLRootFinderDeriv.h.

Member Data Documentation

◆ fFunction

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

Definition at line 131 of file GSLRootFinderDeriv.h.

◆ fIter

int ROOT::Math::GSLRootFinderDeriv::fIter
private

Definition at line 136 of file GSLRootFinderDeriv.h.

◆ fPrevRoot

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

Definition at line 135 of file GSLRootFinderDeriv.h.

◆ fRoot

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

Definition at line 134 of file GSLRootFinderDeriv.h.

◆ fS

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

Definition at line 132 of file GSLRootFinderDeriv.h.

◆ fStatus

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

Definition at line 137 of file GSLRootFinderDeriv.h.

◆ fValidPoint

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

Definition at line 138 of file GSLRootFinderDeriv.h.

Libraries for ROOT::Math::GSLRootFinderDeriv:

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