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 () | |
virtual | ~GSLRootFinderDeriv () |
int | Iterate () |
iterate (return GSL_SUCCESS in case of successful iteration) More... | |
int | Iterations () const |
Return number of iterations. More... | |
const char * | Name () const |
Return name of root finder algorithm. More... | |
double | Root () const |
Returns the previously calculated root. More... | |
bool | SetFunction (const IGradFunction &f, double xstart) |
Sets the function for algorithms using derivatives. More... | |
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 | SetFunction (GSLFuncPointer f, GSLFuncPointer df, GSLFdFPointer fdf, void *p, double Root) |
bool | Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) |
Find the root (return false if failed) 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 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... | |
virtual int | Iterations () const |
Return number of iterations used to find the root Must be implemented by derived classes. More... | |
virtual const char * | Name () const =0 |
Return name of root finder algorithm. More... | |
virtual double | Root () const =0 |
Returns the previously calculated root. More... | |
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... | |
virtual bool | Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10)=0 |
Stimates the root for the function. More... | |
virtual int | Status () const =0 |
Returns the status of the previous estimate. More... | |
Protected Member Functions | |
void | FreeSolver () |
void | SetSolver (GSLRootFdFSolver *s) |
Private Member Functions | |
GSLRootFinderDeriv (const GSLRootFinderDeriv &) | |
GSLRootFinderDeriv & | operator= (const GSLRootFinderDeriv &) |
Private Attributes | |
GSLFunctionDerivWrapper * | fFunction |
int | fIter |
double | fPrevRoot |
double | fRoot |
GSLRootFdFSolver * | fS |
int | fStatus |
bool | fValidPoint |
#include <Math/GSLRootFinderDeriv.h>
Definition at line 103 of file GSLRootFinderDeriv.h.
typedef double(* ROOT::Math::GSLRootFinderDeriv::GSLFuncPointer) (double, void *) |
Definition at line 102 of file GSLRootFinderDeriv.h.
ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv | ( | ) |
Definition at line 48 of file GSLRootFinderDeriv.cxx.
|
virtual |
Definition at line 58 of file GSLRootFinderDeriv.cxx.
|
private |
Definition at line 64 of file GSLRootFinderDeriv.cxx.
|
protected |
Definition at line 102 of file GSLRootFinderDeriv.cxx.
|
virtual |
iterate (return GSL_SUCCESS in case of successful iteration)
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 107 of file GSLRootFinderDeriv.cxx.
|
inlinevirtual |
Return number of iterations.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 117 of file GSLRootFinderDeriv.h.
|
virtual |
Return name of root finder algorithm.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 132 of file GSLRootFinderDeriv.cxx.
|
private |
Definition at line 68 of file GSLRootFinderDeriv.cxx.
|
virtual |
Returns the previously calculated root.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 127 of file GSLRootFinderDeriv.cxx.
|
inlinevirtual |
Sets the function for algorithms using derivatives.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 96 of file GSLRootFinderDeriv.h.
|
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.
|
inlinevirtual |
Sets the function for algorithms using derivatives.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 45 of file IRootFinderMethod.h.
bool ROOT::Math::GSLRootFinderDeriv::SetFunction | ( | GSLFuncPointer | f, |
GSLFuncPointer | df, | ||
GSLFdFPointer | fdf, | ||
void * | p, | ||
double | Root | ||
) |
Definition at line 79 of file GSLRootFinderDeriv.cxx.
|
protected |
Definition at line 97 of file GSLRootFinderDeriv.cxx.
|
virtual |
Find the root (return false if failed)
Implements ROOT::Math::IRootFinderMethod.
Definition at line 137 of file GSLRootFinderDeriv.cxx.
|
inlinevirtual |
Return the status of last root finding.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 122 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 134 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 139 of file GSLRootFinderDeriv.h.
|
mutableprivate |
Definition at line 138 of file GSLRootFinderDeriv.h.
|
mutableprivate |
Definition at line 137 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 135 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 140 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 141 of file GSLRootFinderDeriv.h.