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 () | |
GSLRootFinder (const GSLRootFinder &)=delete | |
GSLRootFinder (GSLRootFinder &&)=delete | |
~GSLRootFinder () override | |
int | Iterate () override |
This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return an error if it's not one of them. | |
int | Iterations () const override |
Return number of iterations. | |
const char * | Name () const override |
double GSLRootFinder::XLower() const { return fXlow; } | |
GSLRootFinder & | operator= (const GSLRootFinder &)=delete |
GSLRootFinder & | operator= (GSLRootFinder &&)=delete |
double | Root () const override |
Returns the previously calculated root. | |
bool | SetFunction (const IGenFunction &f, double xlow, double xup) override |
Sets the function for the rest of the algorithms. | |
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, void *params, double xlow, double xup) |
bool | Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) override |
Find the root. | |
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 (GSLRootFSolver *s) |
Private Attributes | |
GSLFunctionWrapper * | fFunction |
int | fIter |
double | fRoot |
GSLRootFSolver * | fS |
int | fStatus |
bool | fValidInterval |
double | fXlow |
double | fXup |
#include <Math/GSLRootFinder.h>
Definition at line 94 of file GSLRootFinder.h.
ROOT::Math::GSLRootFinder::GSLRootFinder | ( | ) |
Definition at line 49 of file GSLRootFinder.cxx.
|
override |
Definition at line 59 of file GSLRootFinder.cxx.
|
delete |
|
delete |
|
protected |
Definition at line 101 of file GSLRootFinder.cxx.
|
overridevirtual |
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 106 of file GSLRootFinder.cxx.
|
inlineoverridevirtual |
Return number of iterations.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 112 of file GSLRootFinder.h.
|
overridevirtual |
double GSLRootFinder::XLower() const { return fXlow; }
double GSLRootFinder::XUpper() const { return fXup; }
Implements ROOT::Math::IRootFinderMethod.
Definition at line 147 of file GSLRootFinder.cxx.
|
delete |
|
delete |
|
overridevirtual |
Returns the previously calculated root.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 134 of file GSLRootFinder.cxx.
|
overridevirtual |
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 81 of file GSLRootFinder.cxx.
|
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::GSLRootFinder::SetFunction | ( | GSLFuncPointer | f, |
void * | params, | ||
double | xlow, | ||
double | xup | ||
) |
Definition at line 65 of file GSLRootFinder.cxx.
|
protected |
Definition at line 96 of file GSLRootFinder.cxx.
|
overridevirtual |
Find the root.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 152 of file GSLRootFinder.cxx.
|
inlineoverridevirtual |
Return the status of last root finding.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 117 of file GSLRootFinder.h.
|
private |
Definition at line 131 of file GSLRootFinder.h.
|
private |
Definition at line 137 of file GSLRootFinder.h.
|
private |
Definition at line 134 of file GSLRootFinder.h.
|
private |
Definition at line 132 of file GSLRootFinder.h.
|
private |
Definition at line 138 of file GSLRootFinder.h.
|
private |
Definition at line 139 of file GSLRootFinder.h.
|
private |
Definition at line 135 of file GSLRootFinder.h.
|
private |
Definition at line 136 of file GSLRootFinder.h.