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)
226 bool ret =
fSolver->SetFunction(wf, start);
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);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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