40 #include "gsl/gsl_roots.h"
41 #include "gsl/gsl_errno.h"
51 fRoot(0), fXlow(0), fXup(0),
52 fIter(0), fStatus(-1),
72 if (
this == &rhs)
return *
this;
122 MATH_ERROR_MSG(
"GSLRootFinder::Iterate",
" Function is not valid");
127 MATH_ERROR_MSG(
"GSLRootFinder::Iterate",
" Interval is not valid");
132 status = gsl_root_fsolver_iterate(
fS->
Solver());
161 return gsl_root_fsolver_name(
fS->
Solver() );
175 MATH_ERROR_MSG(
"GSLRootFinder::Solve",
"error returned when performing an iteration");
186 while (status == GSL_CONTINUE && iter < maxIter);
187 if (status == GSL_CONTINUE) {
189 MATH_INFO_MSGVAL(
"GSLRootFinder::Solve",
"exceeded max iterations, reached tolerance is not sufficient",tol);
double Root() const
Returns the previously calculated root.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Root-Finder implementation class using GSL.
GSLRootFinder & operator=(const GSLRootFinder &)
Base class for GSL Root-Finding algorithms for one dimensional functions which do not use function de...
void SetFunction(const FuncType &f)
fill the GSL C struct from a generic C++ callable object implementing operator()
ClassImp(TIterator) Bool_t TIterator return false
Compare two iterator objects.
const char * Name() const
double GSLRootFinder::XLower() const { return fXlow; }
Interface for finding function roots of one-dimensional functions.
bool Solve(int maxIter=100, double absTol=1E-8, double relTol=1E-10)
Find the root.
std::map< std::string, std::string >::const_iterator iter
static Vc_ALWAYS_INLINE Vector< T > abs(const Vector< T > &x)
#define MATH_ERROR_MSG(loc, str)
gsl_root_fsolver * Solver() const
int Iterate()
This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return a...
double(* GSLFuncPointer)(double, void *)
Function pointer corresponding to gsl_function signature.
int TestInterval(double xlow, double xup, double epsAbs, double epsRel)
GSLFunctionWrapper * fFunction
bool IsValid()
check if function is valid (has been set)
void SetFuncPointer(GSLFuncPointer f)
set in the GSL C struct the pointer to the function evaluation
void SetSolver(GSLRootFSolver *s)
Wrapper class to the gsl_function C structure.
void SetParams(void *p)
set in the GSL C struct the extra-object pointer
bool SetFunction(const IGenFunction &f, double xlow, double xup)
Sets the function for the rest of the algorithms.
#define MATH_INFO_MSGVAL(loc, str, x)