13#ifndef ROOT_Math_WrappedMultiTF1
14#define ROOT_Math_WrappedMultiTF1
93 unsigned int NDim()
const override
113 unsigned int NPar()
const override
193 Error(
"DoParameterDerivative",
"The vectorized implementation of DoParameterDerivative does not support"
194 "general linear functions built in TFormula with ++");
207 return (
const_cast<TFormula *
>(df))->EvalPar(
x);
233 while (
fLinear && ip < fFunc->GetNpar()) {
248 fLinear(rhs.fLinear),
249 fPolynomial(rhs.fPolynomial),
250 fOwnFunc(rhs.fOwnFunc),
263 if (
this == &rhs)
return *
this;
282 fFunc->SetParameters(par);
284 double prec = this->GetDerivPrecision();
285 fFunc->GradientPar(
x, grad, prec);
287 unsigned int np = NPar();
288 for (
unsigned int i = 0; i <
np; ++i)
289 grad[i] = DoParameterDerivative(
x, par, i);
299 fFunc->SetParameters(
p);
300 double prec = this->GetDerivPrecision();
301 return fFunc->GradientPar(ipar,
x, prec);
306 if (ipar == 0)
return 1.0;
308 return vecCore::math::Pow(
x[0],
static_cast<T>(ipar));
310 return std::pow(
x[0],
static_cast<int>(ipar));
332 const TF1 *funcToCopy = (
f) ?
f : fFunc;
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Documentation for the abstract class IBaseFunctionMultiDim.
Interface (abstract class) for parametric gradient multi-dimensional functions providing in addition ...
Class to Wrap a ROOT Function class (like TF1) in a IParamMultiFunction interface of multi-dimensions...
T DoParameterDerivative(const T *x, const double *p, unsigned int ipar) const override
evaluate the partial derivative with respect to the parameter
~WrappedMultiTF1Templ() override
Destructor (no operations).
void SetAndCopyFunction(const TF1 *f=0)
method to set a new function pointer and copy it inside.
const double * Parameters() const override
get the parameter values (return values from TF1)
T DoEval(const T *x) const override
evaluate function using the cached parameter values (of TF1) re-implement for better efficiency
static void SetDerivPrecision(double eps)
precision value used for calculating the derivative step-size h = eps * |x|.
static double GetDerivPrecision()
get precision value used for calculating the derivative step-size
ROOT::Math::IParametricGradFunctionMultiDimTempl< T > BaseParamFunc
WrappedMultiTF1Templ & operator=(const WrappedMultiTF1Templ< T > &rhs)
Assignment operator.
std::string ParameterName(unsigned int i) const override
return parameter name (from TF1)
const TF1 * GetFunction() const
method to retrieve the internal function pointer
unsigned int NDim() const override
Retrieve the dimension of the function.
unsigned int NPar() const override
return number of parameters
IMultiGenFunctionTempl< T > * Clone() const override
Clone the wrapper but not the original function.
void SetParameters(const double *p) override
set parameter values (only the cached one in this class,leave unchanges those of TF1)
void ParameterGradient(const T *x, const double *par, T *grad) const override
Evaluate the all the derivatives (gradient vector) of the function with respect to the parameters at ...
ROOT::Math::IParametricFunctionMultiDimTempl< T >::BaseFunc BaseFunc
T DoEvalVec(const T *x) const
evaluate function using the cached parameter values (of TF1) re-implement for better efficiency
T DoEvalPar(const T *x, const double *p) const override
evaluate function passing coordinates x and vector of parameters
WrappedMultiTF1Templ(TF1 &f, unsigned int dim=0)
constructor from a function pointer to a TF1 If dim = 0 dimension is taken from TF1::GetNdim().
virtual Int_t GetNumber() const
virtual Int_t GetNpar() const
virtual Double_t * GetParameters() const
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Evaluate function with given coordinates and parameters.
virtual const char * GetParName(Int_t ipar) const
virtual Bool_t IsLinear() const
virtual void SetParameters(const Double_t *params)
virtual Int_t GetNdim() const
virtual const TObject * GetLinearPart(Int_t i) const
RVec< PromoteTypes< T0, T1 > > pow(const T0 &x, const RVec< T1 > &v)
Namespace for new Math classes and functions.
double DerivPrecision(double eps)
TF1 * CopyTF1Ptr(const TF1 *funcToCopy)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Double_t SignalingNaN()
Returns a signaling NaN as defined by IEEE 754](http://en.wikipedia.org/wiki/NaN#Signaling_NaN).
static double DoParameterDerivative(const WrappedMultiTF1Templ< double > *wrappedFunc, const double *x, unsigned int ipar)
Auxiliar class to bypass the (provisional) lack of vectorization in TFormula::EvalPar.
static T DoParameterDerivative(const WrappedMultiTF1Templ< T > *, const T *, unsigned int)