User Class to find the Root of one dimensional functions.
The GSL Methods are implemented in MathMore and they are loaded automatically via the plug-in manager
The possible types of Root-finding algorithms are:
This class does not cupport copying
Definition at line 84 of file RootFinder.h.
|
| RootFinder (RootFinder::EType type=RootFinder::kBRENT) |
| Construct a Root-Finder algorithm. More...
|
|
virtual | ~RootFinder () |
|
int | Iterate () |
| Perform a single iteration and return the Status. More...
|
|
int | Iterations () const |
| Return the number of iteration performed to find the Root. More...
|
|
const char * | Name () const |
| Return the current and latest estimate of the lower value of the Root-finding interval (for bracketing algorithms) More...
|
|
double | Root () const |
| Return the current and latest estimate of the Root. More...
|
|
bool | SetFunction (const IGenFunction &f, double xlow, double xup) |
| Provide to the solver the function and the initial search interval [xlow, xup] for algorithms not using derivatives (bracketing algorithms) The templated function f must be of a type implementing the operator() method, double operator() ( double x ) Returns non zero if interval is not valid (i.e. More...
|
|
bool | SetFunction (const IGradFunction &f, double xstart) |
| Provide to the solver the function and an initial estimate of the root, for algorithms using derivatives. More...
|
|
bool | SetMethod (RootFinder::EType type=RootFinder::kBRENT) |
|
template<class Function , class Derivative > |
bool | Solve (Function &f, Derivative &d, double start, int maxIter=100, double absTol=1E-8, double relTol=1E-10) |
|
template<class Function > |
bool | Solve (Function &f, double min, double max, int maxIter=100, double absTol=1E-8, double relTol=1E-10) |
|
bool | Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) |
| Compute the roots iterating until the estimate of the Root is within the required tolerance returning the iteration Status. More...
|
|
int | Status () const |
| Return the status of the last estimate of the Root = 0 OK, not zero failure. More...
|
|
#include <Math/RootFinder.h>
◆ EType
Enumerator |
---|
kBRENT | |
kGSL_BISECTION | |
kGSL_FALSE_POS | |
kGSL_BRENT | |
kGSL_NEWTON | |
kGSL_SECANT | |
kGSL_STEFFENSON | |
Definition at line 88 of file RootFinder.h.
◆ RootFinder() [1/2]
Construct a Root-Finder algorithm.
Definition at line 37 of file RootFinder.cxx.
◆ ~RootFinder()
ROOT::Math::RootFinder::~RootFinder |
( |
| ) |
|
|
virtual |
◆ RootFinder() [2/2]
ROOT::Math::RootFinder::RootFinder |
( |
const RootFinder & |
| ) |
|
|
inlineprivate |
◆ Iterate()
int ROOT::Math::RootFinder::Iterate |
( |
| ) |
|
|
inline |
Perform a single iteration and return the Status.
Definition at line 164 of file RootFinder.h.
◆ Iterations()
int ROOT::Math::RootFinder::Iterations |
( |
| ) |
const |
|
inline |
Return the number of iteration performed to find the Root.
Definition at line 157 of file RootFinder.h.
◆ Name()
const char * ROOT::Math::RootFinder::Name |
( |
| ) |
const |
|
inline |
Return the current and latest estimate of the lower value of the Root-finding interval (for bracketing algorithms)
Return the current and latest estimate of the upper value of the Root-finding interval (for bracketing algorithms) Get Name of the Root-finding solver algorithm
Definition at line 201 of file RootFinder.h.
◆ operator=()
◆ Root()
double ROOT::Math::RootFinder::Root |
( |
| ) |
const |
|
inline |
Return the current and latest estimate of the Root.
Definition at line 171 of file RootFinder.h.
◆ SetFunction() [1/2]
bool ROOT::Math::RootFinder::SetFunction |
( |
const IGenFunction & |
f, |
|
|
double |
xlow, |
|
|
double |
xup |
|
) |
| |
|
inline |
Provide to the solver the function and the initial search interval [xlow, xup] for algorithms not using derivatives (bracketing algorithms) The templated function f must be of a type implementing the operator() method, double operator() ( double x ) Returns non zero if interval is not valid (i.e.
does not contains a root)
Definition at line 120 of file RootFinder.h.
◆ SetFunction() [2/2]
bool ROOT::Math::RootFinder::SetFunction |
( |
const IGradFunction & |
f, |
|
|
double |
xstart |
|
) |
| |
|
inline |
Provide to the solver the function and an initial estimate of the root, for algorithms using derivatives.
The templated function f must be of a type implementing the operator() and the Gradient() methods. double operator() ( double x ) Returns non zero if starting point is not valid
Definition at line 134 of file RootFinder.h.
◆ SetMethod()
◆ Solve() [1/3]
template<class
Function , class Derivative >
bool ROOT::Math::RootFinder::Solve |
( |
Function & |
f, |
|
|
Derivative & |
d, |
|
|
double |
start, |
|
|
int |
maxIter = 100 , |
|
|
double |
absTol = 1E-8 , |
|
|
double |
relTol = 1E-10 |
|
) |
| |
◆ Solve() [2/3]
bool ROOT::Math::RootFinder::Solve |
( |
Function & |
f, |
|
|
double |
min, |
|
|
double |
max, |
|
|
int |
maxIter = 100 , |
|
|
double |
absTol = 1E-8 , |
|
|
double |
relTol = 1E-10 |
|
) |
| |
◆ Solve() [3/3]
bool ROOT::Math::RootFinder::Solve |
( |
int |
maxIter = 100 , |
|
|
double |
absTol = 1E-8 , |
|
|
double |
relTol = 1E-10 |
|
) |
| |
|
inline |
Compute the roots iterating until the estimate of the Root is within the required tolerance returning the iteration Status.
Definition at line 150 of file RootFinder.h.
◆ Status()
int ROOT::Math::RootFinder::Status |
( |
| ) |
const |
|
inline |
Return the status of the last estimate of the Root = 0 OK, not zero failure.
Definition at line 179 of file RootFinder.h.
◆ fSolver
[legend]