31 #ifndef ROOT_Math_RootFinder 32 #define ROOT_Math_RootFinder 104 if (
this == &rhs)
return *
this;
138 template<
class Function,
class Derivative>
139 bool Solve(Function &f, Derivative &d,
double start,
140 int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10);
142 template<
class Function>
143 bool Solve(Function &f,
double min,
double max,
144 int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10);
150 bool Solve(
int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10) {
224 template<
class Function,
class Derivative>
226 int maxIter,
double absTol,
double relTol)
231 if (!ret)
return false;
232 return Solve(maxIter, absTol, relTol);
235 template<
class Function>
237 int maxIter,
double absTol,
double relTol)
242 if (!ret)
return false;
243 return Solve(maxIter, absTol, relTol);
User Class to find the Root of one dimensional functions.
double Root() const
Return the current and latest estimate of the Root.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Namespace for new ROOT classes and functions.
GradFunctor1D class for one-dimensional gradient functions.
virtual double Root() const =0
Returns the previously calculated root.
int Iterations() const
Return the number of iteration performed to find the Root.
Interface (abstract class) for one-dimensional functions providing a gradient calculation.
Template class to wrap any C++ callable object which takes one argument i.e.
Interface for finding function roots of one-dimensional functions.
int Iterate()
Perform a single iteration and return the Status.
const char * Name() const
Return the current and latest estimate of the lower value of the Root-finding interval (for bracketin...
RootFinder(RootFinder::EType type=RootFinder::kBRENT)
Construct a Root-Finder algorithm.
RootFinder(const RootFinder &)
constexpr Double_t E()
Base of natural log: .
RootFinder & operator=(const RootFinder &rhs)
bool SetMethod(RootFinder::EType type=RootFinder::kBRENT)
virtual int Iterations() const
Return number of iterations used to find the root Must be implemented by derived classes.
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 usi...
virtual bool SetFunction(const ROOT::Math::IGradFunction &, double)
Sets the function for algorithms using derivatives.
virtual bool Solve(int maxIter=100, double absTol=1E-8, double relTol=1E-10)=0
Stimates the root for the function.
IRootFinderMethod * fSolver
Namespace for new Math classes and functions.
virtual const char * Name() const =0
Return name of root finder algorithm.
virtual int Status() const =0
Returns the status of the previous estimate.
bool SetFunction(const IGradFunction &f, double xstart)
Provide to the solver the function and an initial estimate of the root, for algorithms using derivati...
virtual int Iterate()
This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return a...
bool Solve(Function &f, Derivative &d, double start, int maxIter=100, double absTol=1E-8, double relTol=1E-10)
int Status() const
Return the status of the last estimate of the Root = 0 OK, not zero failure.
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...