20#ifndef ROOT_Math_RootFinder
21#define ROOT_Math_RootFinder
107 return fSolver->SetFunction(
f, xlow, xup);
121 return fSolver->SetFunction(
f, xstart);
124 template<
class Function,
class Derivative>
126 int maxIter = 100,
double absTol = 1E-8,
double relTol = 1E-10);
128 template<
class Function>
130 int maxIter = 100,
double absTol = 1E-8,
double relTol = 1E-10);
136 bool Solve(
int maxIter = 100,
double absTol = 1E-8,
double relTol = 1E-10) {
137 return fSolver->Solve( maxIter, absTol, relTol );
220template<
class Function,
class Derivative>
222 int maxIter,
double absTol,
double relTol)
227 if (!
ret)
return false;
228 return Solve(maxIter, absTol, relTol);
241template<
class Function>
243 int maxIter,
double absTol,
double relTol)
247 bool ret =
fSolver->SetFunction(wf, min, max);
248 if (!
ret)
return false;
249 return Solve(maxIter, absTol, relTol);
Double_t(* Function)(Double_t)
GradFunctor1D class for one-dimensional gradient functions.
Interface for finding function roots of one-dimensional functions.
bool SetMethod(RootFinder::EType type=RootFinder::kBRENT)
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...
int Iterations() const
Return the number of iteration performed to find the Root.
RootFinder(const RootFinder &)=delete
RootFinder(RootFinder::EType type=RootFinder::kBRENT)
Construct a Root-Finder algorithm.
const char * Name() const
Return the current and latest estimate of the lower value of the Root-finding interval (for bracketin...
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...
IRootFinderMethod * fSolver
bool SetFunction(const IGradFunction &f, double xstart)
Provide to the solver the function and an initial estimate of the root, for algorithms using derivati...
bool Solve(Function &f, Derivative &d, double start, int maxIter=100, double absTol=1E-8, double relTol=1E-10)
Solve f(x) = 0, given a derivative d.
RootFinder & operator=(const RootFinder &rhs)=delete
double Root() const
Return the current and latest estimate of the Root.
int Iterate()
Perform a single iteration and return the Status.
RootFinder(RootFinder &&)=delete
int Status() const
Return the status of the last estimate of the Root = 0 OK, not zero failure.
Template class to wrap any C++ callable object which takes one argument i.e.
IGradientFunctionOneDim IGradFunction
IBaseFunctionOneDim IGenFunction