31 #ifndef ROOT_Math_RootFinder 32 #define ROOT_Math_RootFinder 35 #ifndef ROOT_Math_IFunctionfwd 39 #ifndef ROOT_Math_IRootFinderMethod 108 if (
this == &rhs)
return *
this;
142 template<
class Function,
class Derivative>
143 bool Solve(Function &
f, Derivative &d,
double start,
144 int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10);
146 template<
class Function>
147 bool Solve(Function &f,
double min,
double max,
148 int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10);
154 bool Solve(
int maxIter = 100,
double absTol = 1
E-8,
double relTol = 1
E-10) {
224 #ifndef ROOT_Math_WrappedFunction 228 #ifndef ROOT_Math_Functor 232 template<
class Function,
class Derivative>
234 int maxIter,
double absTol,
double relTol)
239 if (!ret)
return false;
240 return Solve(maxIter, absTol, relTol);
243 template<
class Function>
245 int maxIter,
double absTol,
double relTol)
250 if (!ret)
return false;
251 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...
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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 &)
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...