18 #ifndef ROOT_Math_IFunction 19 #define ROOT_Math_IFunction 86 virtual unsigned int NDim()
const = 0;
102 template <
class Iterator>
179 virtual double DoEval(
double x)
const = 0;
212 virtual void Gradient(
const T *
x,
T *grad)
const = 0;
217 T Derivative(
const T *x,
unsigned int icoord = 0)
const {
return DoDerivative(x, icoord); }
226 virtual void FdF(
const T *x,
T &
f,
T *df)
const = 0;
234 virtual T DoDerivative(
const T *x,
unsigned int icoord)
const = 0;
260 return DoDerivative(x);
271 virtual void FdF(
double x,
double &
f,
double &df)
const = 0;
279 return DoDerivative(*x);
287 g[0] = DoDerivative(*x);
293 void FdF(
const double *x,
double &f,
double *df)
const 306 virtual double DoDerivative(
double x)
const = 0;
344 unsigned int ndim =
NDim();
345 for (
unsigned int icoord = 0; icoord < ndim; ++icoord)
346 grad[icoord] = BaseGrad::Derivative(x, icoord);
405 virtual void FdF(
double x,
double &
f,
double &df)
const virtual ~IGradientMultiDimTempl()
virual destructor
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
Namespace for new ROOT classes and functions.
void FdF(const double *x, double &f, double *df) const
Compatibility method with multi-dimensional interface for Gradient and function evaluation.
IBaseFunctionMultiDimTempl()
T Derivative(const T *x, unsigned int icoord=0) const
Return the partial derivative with respect to the passed coordinate.
IBaseFunctionOneDim BaseFunc
double Derivative(const double *x) const
Compatibility method with multi-dimensional interface for partial derivative.
virtual IBaseFunctionMultiDimTempl< T > * Clone() const =0
Clone a function.
virtual void Gradient(const T *x, T *grad) const
Evaluate all the vector of function derivatives (gradient) at a point x.
IBaseFunctionMultiDimTempl< T > BaseFunc
Interface (abstract class) for one-dimensional functions providing a gradient calculation.
virtual ~IGradientFunctionMultiDimTempl()
Virtual Destructor (no operations)
Specialized Gradient interface(abstract class) for one dimensional functions It provides a method to ...
void Gradient(const double *x, double *g) const
Compatibility method with multi-dimensional interface for Gradient.
virtual ~IBaseFunctionMultiDimTempl()
virtual destructor
Gradient interface (abstract class) defining the signature for calculating the gradient of a multi-di...
Documentation for the abstract class IBaseFunctionMultiDim.
virtual void FdF(double x, double &f, double &df) const
Optimized method to evaluate at the same time the function value and derivative at a point x...
IBaseFunctionOneDim BaseFunc
double operator()(const double *x) const
Evaluate the function at a point x[].
virtual void FdF(const T *x, T &f, T *df) const
Optimized method to evaluate at the same time the function value and derivative at a point x...
virtual ~IGradientOneDim()
virtual destructor
IBaseFunctionMultiDimTempl< T > BaseFunc
IGradientMultiDimTempl< T > BaseGrad
virtual T DoEval(const T *x) const =0
Implementation of the evaluation function.
Namespace for new Math classes and functions.
virtual ~IGradientFunctionOneDim()
Virtual Destructor (no operations)
virtual ~IBaseFunctionOneDim()
virtual destructor
double Derivative(double x) const
Return the derivative of the function at a point x Use the private method DoDerivative.
virtual unsigned int NDim() const =0
Retrieve the dimension of the function.
double operator()(double x) const
Evaluate the function at a point x Use the a pure virtual private method DoEval which must be impleme...
T operator()(const T *x) const
Evaluate the function at a point x[].