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