Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches

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 IGenFunctionfFunction = nullptr
 
int fNIter = 0
 
double fRoot = 0.
 
int fStatus = -1
 
double fXMax = 0.
 
double fXMin = 0.
 

#include <Math/ModABRootFinder.h>

Inheritance diagram for ROOT::Math::ModABRootFinder:
[legend]

Member Function Documentation

◆ Iterations()

int ROOT::Math::ModABRootFinder::Iterations ( ) const
inlineoverridevirtual

Return number of iteration used to find minimum.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 65 of file ModABRootFinder.h.

◆ Name()

const char * ROOT::Math::ModABRootFinder::Name ( ) const
overridevirtual

Return name of root finder algorithm ("ModABRootFinder").

Implements ROOT::Math::IRootFinderMethod.

Definition at line 38 of file ModABRootFinder.cxx.

◆ Root()

double ROOT::Math::ModABRootFinder::Root ( ) const
inlineoverridevirtual

Returns root value.

Need to call first Solve().

Implements ROOT::Math::IRootFinderMethod.

Definition at line 59 of file ModABRootFinder.h.

◆ SetFunction() [1/3]

virtual bool ROOT::Math::IRootFinderMethod::SetFunction ( const ROOT::Math::IGenFunction & ,
double ,
double  )
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.

◆ SetFunction() [2/3]

bool ROOT::Math::ModABRootFinder::SetFunction ( const ROOT::Math::IGenFunction & ,
double ,
double  )
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.

◆ SetFunction() [3/3]

virtual bool ROOT::Math::IRootFinderMethod::SetFunction ( const ROOT::Math::IGradFunction & ,
double  )
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.

◆ Solve()

bool ROOT::Math::ModABRootFinder::Solve ( int maxIter = 100,
double absTol = 1E-8,
double relTol = 1E-10 )
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.

◆ Status()

int ROOT::Math::ModABRootFinder::Status ( ) const
inlineoverridevirtual

Returns status of last estimate.

If = 0 is OK

Implements ROOT::Math::IRootFinderMethod.

Definition at line 62 of file ModABRootFinder.h.

Member Data Documentation

◆ fFunction

const IGenFunction* ROOT::Math::ModABRootFinder::fFunction = nullptr
private

Definition at line 71 of file ModABRootFinder.h.

◆ fNIter

int ROOT::Math::ModABRootFinder::fNIter = 0
private

Definition at line 72 of file ModABRootFinder.h.

◆ fRoot

double ROOT::Math::ModABRootFinder::fRoot = 0.
private

Definition at line 76 of file ModABRootFinder.h.

◆ fStatus

int ROOT::Math::ModABRootFinder::fStatus = -1
private

Definition at line 73 of file ModABRootFinder.h.

◆ fXMax

double ROOT::Math::ModABRootFinder::fXMax = 0.
private

Definition at line 75 of file ModABRootFinder.h.

◆ fXMin

double ROOT::Math::ModABRootFinder::fXMin = 0.
private

Definition at line 74 of file ModABRootFinder.h.

Libraries for ROOT::Math::ModABRootFinder:

The documentation for this class was generated from the following files: