Class for finding the root of a one dimensional function using the ModAB algorithm.
It is based on the Modified Anderson-Björck method (2022 Ganchovski & Traykov) that adaptively switches between bisection and regula-falsi with side-correction, yielding superlinear convergence on well-behaved functions while retaining the robustness of bisection.
Definition at line 37 of file ModABRootFinder.h.
Public Member Functions | |
| int | Iterations () const override |
| Return number of iteration used to find minimum. | |
| const char * | Name () const override |
| Return name of root finder algorithm ("ModABRootFinder"). | |
| double | Root () const override |
| Returns root value. | |
| virtual bool | SetFunction (const ROOT::Math::IGenFunction &, double, double) |
| Set function to solve and the interval in where to look for the root. | |
| bool | SetFunction (const ROOT::Math::IGenFunction &f, double xlow, double xup) override |
| Sets the function for the rest of the algorithms. | |
| virtual bool | SetFunction (const ROOT::Math::IGradFunction &, double) |
| Set function to solve and the interval in where to look for the root. | |
| bool | Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) override |
| Returns the X value corresponding to the function value fy for (xmin<x<xmax). | |
| int | Status () const override |
| Returns status of last estimate. | |
Public Member Functions inherited from ROOT::Math::IRootFinderMethod | |
| IRootFinderMethod () | |
| Default Constructor. | |
| virtual | ~IRootFinderMethod () |
| Default Destructor. | |
| 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. | |
Private Attributes | |
| const IGenFunction * | fFunction = nullptr |
| int | fNIter = 0 |
| double | fRoot = 0. |
| int | fStatus = -1 |
| double | fXMax = 0. |
| double | fXMin = 0. |
#include <Math/ModABRootFinder.h>
|
inlineoverridevirtual |
Return number of iteration used to find minimum.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 65 of file ModABRootFinder.h.
|
overridevirtual |
Return name of root finder algorithm ("ModABRootFinder").
Implements ROOT::Math::IRootFinderMethod.
Definition at line 38 of file ModABRootFinder.cxx.
|
inlineoverridevirtual |
Returns root value.
Need to call first Solve().
Implements ROOT::Math::IRootFinderMethod.
Definition at line 59 of file ModABRootFinder.h.
|
inlinevirtual |
Set function to solve and the interval in where to look for the root.
@param f Function to be minimized. @param xlow Lower bound of the search interval. @param xup Upper bound of the search interval.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 53 of file IRootFinderMethod.h.
|
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 21 of file ModABRootFinder.cxx.
|
inlinevirtual |
Set function to solve and the interval in where to look for the root.
@param f Function to be minimized. @param xlow Lower bound of the search interval. @param xup Upper bound of the search interval.
Reimplemented from ROOT::Math::IRootFinderMethod.
Definition at line 45 of file IRootFinderMethod.h.
|
overridevirtual |
Returns the X value corresponding to the function value fy for (xmin<x<xmax).
Method: Modified Anderson-Björck method is applied on the bracketed interval.
@param maxIter maximum number of iterations. @param absTol desired absolute error in the minimum position. @param relTol desired relative error in the minimum position.
Implements ROOT::Math::IRootFinderMethod.
Definition at line 50 of file ModABRootFinder.cxx.
|
inlineoverridevirtual |
Returns status of last estimate.
If = 0 is OK
Implements ROOT::Math::IRootFinderMethod.
Definition at line 62 of file ModABRootFinder.h.
|
private |
Definition at line 71 of file ModABRootFinder.h.
|
private |
Definition at line 72 of file ModABRootFinder.h.
|
private |
Definition at line 76 of file ModABRootFinder.h.
|
private |
Definition at line 73 of file ModABRootFinder.h.
|
private |
Definition at line 75 of file ModABRootFinder.h.
|
private |
Definition at line 74 of file ModABRootFinder.h.