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. | |
GSLRootFinderDeriv & | operator= (const GSLRootFinderDeriv &)=delete |
GSLRootFinderDeriv & | operator= (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 | |
GSLFunctionDerivWrapper * | fFunction |
int | fIter |
double | fPrevRoot |
double | fRoot |
GSLRootFdFSolver * | fS |
int | fStatus |
bool | fValidPoint |
#include <Math/GSLRootFinderDeriv.h>
Definition at line 100 of file GSLRootFinderDeriv.h.
Definition at line 99 of file GSLRootFinderDeriv.h.
ROOT::Math::GSLRootFinderDeriv::GSLRootFinderDeriv | ( | ) |
Definition at line 48 of file GSLRootFinderDeriv.cxx.
|
override |
Definition at line 58 of file GSLRootFinderDeriv.cxx.
|
delete |
|
delete |
|
protected |
Definition at line 88 of file GSLRootFinderDeriv.cxx.
|
overridevirtual |
iterate (return GSL_SUCCESS in case of successful iteration)
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 93 of file GSLRootFinderDeriv.cxx.
|
inlineoverridevirtual |
Return number of iterations.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 114 of file GSLRootFinderDeriv.h.
|
overridevirtual |
Return name of root finder algorithm.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 118 of file GSLRootFinderDeriv.cxx.
|
delete |
|
delete |
|
overridevirtual |
Returns the previously calculated root.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 113 of file GSLRootFinderDeriv.cxx.
|
inlineoverridevirtual |
Sets the function for algorithms using derivatives.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 93 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 65 of file GSLRootFinderDeriv.cxx.
|
protected |
Definition at line 83 of file GSLRootFinderDeriv.cxx.
|
overridevirtual |
Find the root (return false if failed)
Implements ROOT::Math::IRootFinderMethod.
Definition at line 123 of file GSLRootFinderDeriv.cxx.
|
inlineoverridevirtual |
Return the status of last root finding.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 119 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 131 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 136 of file GSLRootFinderDeriv.h.
|
mutableprivate |
Definition at line 135 of file GSLRootFinderDeriv.h.
|
mutableprivate |
Definition at line 134 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 132 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 137 of file GSLRootFinderDeriv.h.
|
private |
Definition at line 138 of file GSLRootFinderDeriv.h.