18#ifndef ROOT_Math_IFunction
19#define ROOT_Math_IFunction
77 virtual unsigned int NDim()
const = 0;
86 template <
class Iterator>
100 unsigned int ndim =
NDim();
111 unsigned int ndim =
NDim();
121 virtual void FdF(
const T *
x, T &
f, T *df)
const
208 virtual void FdF(
double x,
double &
f,
double &df)
const
215 void FdF(
const double *
x,
double &
f,
double *df)
const {
FdF(*
x,
f, *df); }
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Documentation for the abstract class IBaseFunctionMultiDim.
virtual IBaseFunctionMultiDimTempl< T > * Clone() const =0
Clone a function.
virtual bool HasGradient() const
virtual ~IBaseFunctionMultiDimTempl()=default
virtual void Gradient(const T *x, T *grad) const
Evaluate all the vector of function derivatives (gradient) at a point x.
virtual void GradientWithPrevResult(const T *x, T *grad, T *previous_grad, T *previous_g2, T *previous_gstep) const
In some cases, the gradient algorithm will use information from the previous step,...
T operator()(const T *x) const
Evaluate the function at a point x[].
virtual T DoDerivative(const T *, unsigned int) const
Function to evaluate the derivative with respect each coordinate. To be implemented by the derived cl...
virtual T DoDerivativeWithPrevResult(const T *x, unsigned int icoord, T *, T *, T *) const
In some cases, the derivative algorithm will use information from the previous step,...
T Derivative(const T *x, unsigned int icoord=0) const
Return the partial derivative with respect to the passed coordinate.
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.
IBaseFunctionMultiDimTempl< T > BaseFunc
virtual unsigned int NDim() const =0
Retrieve the dimension of the function.
virtual T DoEval(const T *x) const =0
Implementation of the evaluation function. Must be implemented by derived classes.
virtual bool returnsInMinuit2ParameterSpace() const
T Derivative(const T *x, unsigned int icoord, T *previous_grad, T *previous_g2, T *previous_gstep) const
In some cases, the derivative algorithm will use information from the previous step,...
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
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.
double Derivative(const double *x) const
Compatibility method with multi-dimensional interface for partial derivative.
virtual bool HasGradient() const
virtual ~IBaseFunctionOneDim()=default
virtual double DoDerivative(double) const
Function to evaluate the derivative with respect each coordinate. To be implemented by the derived cl...
void FdF(const double *x, double &f, double *df) const
Compatibility method with multi-dimensional interface for Gradient and function evaluation.
IBaseFunctionOneDim BaseFunc
virtual double DoEval(double x) const =0
implementation of the evaluation function. Must be implemented by derived classes
double Derivative(double x) const
Return the derivative of the function at a point x Use the private method DoDerivative.
double operator()(const double *x) const
Evaluate the function at a point x[].
virtual IBaseFunctionOneDim * Clone() const =0
Clone a function.
double operator()(double x) const
Evaluate the function at a point x.
void Gradient(const double *x, double *g) const
Compatibility method with multi-dimensional interface for Gradient.
Interface (abstract class) for multi-dimensional functions providing a gradient calculation.
bool HasGradient() const override
Interface (abstract class) for one-dimensional functions providing a gradient calculation.
bool HasGradient() const override
Namespace for new Math classes and functions.
Namespace for new ROOT classes and functions.