39#include "gsl/gsl_roots.h"
40#include "gsl/gsl_errno.h"
49 fFunction(nullptr), fS(nullptr),
50 fRoot(0), fPrevRoot(0),
51 fIter(0), fStatus(-1),
71 if (
this == &rhs)
return *
this;
111 MATH_ERROR_MSG(
"GSLRootFinderDeriv::Iterate",
" Function is not valid");
115 MATH_ERROR_MSG(
"GSLRootFinderDeriv::Iterate",
" Estimated point is not valid");
120 int status = gsl_root_fdfsolver_iterate(
fS->
Solver());
134 return gsl_root_fdfsolver_name(
fS->
Solver() );
148 MATH_ERROR_MSG(
"GSLRootFinderDeriv::Solve",
"error returned when performing an iteration");
162 while (status == GSL_CONTINUE && iter < maxIter);
164 if (status == GSL_CONTINUE) {
166 MATH_INFO_MSGVAL(
"GSLRootFinderDeriv::Solve",
"exceeded max iterations, reached tolerance is not sufficient",tol);
#define MATH_INFO_MSGVAL(loc, txt, x)
#define MATH_ERROR_MSG(loc, str)
winID h TVirtualViewer3D TVirtualGLPainter p
class to wrap a gsl_function_fdf (with derivatives)
void SetDerivPointer(GSLFuncPointer f)
bool IsValid()
check if function is valid (has been set)
void SetFdfPointer(GSLFdfPointer f)
void SetFuncPointer(GSLFuncPointer f)
gsl_function_fdf * GetFunc()
Root-Finder with derivatives implementation class using GSL.
gsl_root_fdfsolver * Solver() const
Base class for GSL Root-Finding algorithms for one dimensional functions which use function derivativ...
GSLFunctionDerivWrapper * fFunction
const char * Name() const override
Return name of root finder algorithm.
int Iterate() override
iterate (return GSL_SUCCESS in case of successful iteration)
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 (return false if failed)
~GSLRootFinderDeriv() override
bool SetFunction(const IGradFunction &f, double xstart) override
Sets the function for algorithms using derivatives.
GSLRootFinderDeriv & operator=(const GSLRootFinderDeriv &)
void SetSolver(GSLRootFdFSolver *s)
Interface for finding function roots of one-dimensional functions.
Namespace for new Math classes and functions.
int TestDelta(double x1, double x0, double epsAbs, double epsRel)
double(* GSLFuncPointer)(double, void *)
Function pointer corresponding to gsl_function signature.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.