KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
TF1Derivative.cpp
1//Created by KVClassFactory on Fri Nov 6 11:04:13 2015
2//Author: John Frankland,,,
3
4#include "TF1Derivative.h"
5
7
8
9
10
11
12TF1Derivative::TF1Derivative() : TF1(), fFunction(nullptr), fOrder(1)
13{
14}
15
16
17
20
21TF1Derivative::TF1Derivative(TF1* func, int order) : TF1(*func), fFunction(func), fOrder(order)
22{
23 // Constructor with function to differentiate and order required (up to 3rd order).
24}
25
26
27
28
31
33{
34 // Destructor
35}
36
37
38
39
41
43{
44
45 TF1::Copy(obj);
46 TF1Derivative& CastedObj = (TF1Derivative&)obj;
47 CastedObj.fFunction = fFunction;
48 CastedObj.fOrder = fOrder;
49}
50
51
52
55
57{
58 // Returns fOrder-th derivative of function at x (fOrder=1,2,3)
59
61 Double_t result = 0;
62 switch (fOrder) {
63 case 2:
64 result = fFunction->Derivative2(*x, (double*)p);
65 break;
66 case 3:
67 result = fFunction->Derivative3(*x, (double*)p);
68 break;
69 case 1:
70 default:
71 result = fFunction->Derivative(*x, (double*)p);
72 }
73
74 return result;
75}
76
77
78
79
double Double_t
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 result
Numerical derivative of a TF1.
virtual ~TF1Derivative()
Destructor.
Double_t EvalPar(const Double_t *x, const Double_t *params=0)
Returns fOrder-th derivative of function at x (fOrder=1,2,3)
void Copy(TObject &obj) const
virtual Double_t Derivative(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
virtual Double_t Derivative2(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
void Copy(TObject &f1) const override
virtual Double_t EvalPar(const Double_t *x, const Double_t *params=nullptr)
virtual Double_t Derivative3(Double_t x, Double_t *params=nullptr, Double_t epsilon=0.001) const
Double_t x[n]
ClassImp(TPyArg)