40#include "gsl/gsl_roots.h"
41#include "gsl/gsl_errno.h"
72 if (
this == &rhs)
return *
this;
84 int status = gsl_root_fsolver_set(
fS->Solver(),
fFunction->GetFunc(), xlow, xup);
99 int status = gsl_root_fsolver_set(
fS->Solver(),
fFunction->GetFunc(), xlow, xup);
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());
135 fRoot = gsl_root_fsolver_root(
fS->Solver() );
137 fXlow = gsl_root_fsolver_x_lower(
fS->Solver() );
138 fXup = gsl_root_fsolver_x_upper(
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);
#define MATH_INFO_MSGVAL(loc, txt, x)
#define MATH_ERROR_MSG(loc, str)
Wrapper class to the gsl_function C structure.
Root-Finder implementation class using GSL.
double(* GSLFuncPointer)(double, void *)
const char * Name() const override
double GSLRootFinder::XLower() const { return fXlow; }
GSLFunctionWrapper * fFunction
int Iterate() override
This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return a...
~GSLRootFinder() override
void SetSolver(GSLRootFSolver *s)
GSLRootFinder & operator=(const GSLRootFinder &)
double Root() const override
Returns the previously calculated root.
bool Solve(int maxIter=100, double absTol=1E-8, double relTol=1E-10) override
Find the root.
bool SetFunction(const IGenFunction &f, double xlow, double xup) override
Sets the function for the rest of the algorithms.
IRootFinderMethod()
Default Constructor.
int TestInterval(double xlow, double xup, double epsAbs, double epsRel)
IBaseFunctionOneDim IGenFunction
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...