27#ifndef GDERIVATIVE_HPP
28#define GDERIVATIVE_HPP
63 void eps(
const double&
eps);
66 const int&
iter(
void)
const;
68 const double&
eps(
void)
const;
70 const bool&
silent(
void)
const;
73 double value(
const double& x,
const double& step = 0.0);
74 double ridder(
const double& x,
const double& h,
double* err);
75 double minuit2(
const double& x,
double* err);
76 double difference(
const double& x,
const double& h);
80 const int& degree = 2,
81 const int& length = 5);
96 double one(
void)
const;
121 return (
"GDerivative");
Definition of interface for all GammaLib classes.
Single parameter function abstract base class definition.
Interface class for all GammaLib classes.
double one(void) const
Return one.
double operator()(double eps) const
Evaluate minimal difference between two floating points.
Numerical derivatives class.
int m_iter
Number of iterations used.
void copy_members(const GDerivative &dx)
Copy class members.
double smooth_robust(const double &x, const double &h, const int °ree=2, const int &length=5)
Returns smooth noise-robust derivative.
int m_max_iter
Maximum number of iterations.
double minuit2(const double &x, double *err)
Returns derivative using Minuit2 algorithm.
GDerivative(void)
Void constructor.
GDerivative & operator=(const GDerivative &dx)
Assignment operator.
const bool & silent(void) const
Get silence flag.
virtual ~GDerivative(void)
Destructor.
double value(const double &x, const double &step=0.0)
Returns derivative.
void set_tiny(void)
Compute tiny number for Minuit2.
const double & step_frac(void) const
Get step fraction.
double m_eps
Derivative precision.
const double & eps(void) const
Get precision.
std::string classname(void) const
Return class name.
void init_members(void)
Initialise class members.
const int & max_iter(void) const
Return maximum number of iterations.
void free_members(void)
Delete class members.
double m_step_frac
Value fraction to use for initial step.
double m_tiny
Tiny number for minuit2.
const int & iter(void) const
Return number of iterations.
double left_difference(const double &x, const double &h)
Returns gradient computed from left-sided function difference.
const GFunction * function(void) const
Get function.
double right_difference(const double &x, const double &h)
Returns gradient computed from right-sided function difference.
double ridder(const double &x, const double &h, double *err)
Returns derivative by Ridders' method.
bool m_silent
Suppress warnings.
GFunction * m_func
Pointer to function.
GDerivative * clone(void) const
Clone derivative.
std::string print(const GChatter &chatter=NORMAL) const
Print derivative information.
double difference(const double &x, const double &h)
Returns gradient computed from symmetric function difference.
void clear(void)
Clear derivative.
Single parameter function abstract base class.