File indexing completed on 2024-11-15 09:56:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_v5_TFormulaPrimitive
0014 #define ROOT_v5_TFormulaPrimitive
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #include "TNamed.h"
0027 #include "TBits.h"
0028
0029 class TObjArray;
0030
0031 namespace ROOT {
0032
0033 namespace v5 {
0034
0035 class TFormula;
0036
0037 class TFormulaPrimitive : public TNamed
0038 {
0039 friend class ROOT::v5::TFormula;
0040 public:
0041 typedef Double_t (*GenFuncG)(const Double_t*,const Double_t*);
0042 typedef Double_t (*GenFunc0)();
0043 typedef Double_t (*GenFunc10)(Double_t);
0044 typedef Double_t (*GenFunc110)(Double_t,Double_t);
0045 typedef Double_t (*GenFunc1110)(Double_t,Double_t, Double_t);
0046 typedef Double_t (TObject::*TFuncG)(const Double_t*,const Double_t*) const;
0047 typedef Double_t (TObject::*TFunc0)() const;
0048 typedef Double_t (TObject::*TFunc10)(Double_t) const;
0049 typedef Double_t (TObject::*TFunc110)(Double_t,Double_t) const;
0050 typedef Double_t (TObject::*TFunc1110)(Double_t,Double_t,Double_t) const;
0051 protected:
0052 static TObjArray * fgListOfFunction;
0053 static Int_t BuildBasicFormulas();
0054 union {
0055 GenFuncG fFuncG;
0056 GenFunc0 fFunc0;
0057 GenFunc10 fFunc10;
0058 GenFunc110 fFunc110;
0059 GenFunc1110 fFunc1110;
0060 TFuncG fTFuncG;
0061 TFunc0 fTFunc0;
0062 TFunc10 fTFunc10;
0063 TFunc110 fTFunc110;
0064 TFunc1110 fTFunc1110;
0065 };
0066 Int_t fType;
0067 Int_t fNArguments;
0068 Int_t fNParameters;
0069 Bool_t fIsStatic;
0070 private:
0071 TFormulaPrimitive(const TFormulaPrimitive&) = delete;
0072 TFormulaPrimitive& operator=(const TFormulaPrimitive&) = delete;
0073 public:
0074 TFormulaPrimitive();
0075 TFormulaPrimitive(const char *name,const char *formula, GenFunc0 fpointer);
0076 TFormulaPrimitive(const char *name,const char *formula, GenFunc10 fpointer);
0077 TFormulaPrimitive(const char *name,const char *formula, GenFunc110 fpointer);
0078 TFormulaPrimitive(const char *name,const char *formula, GenFunc1110 fpointer);
0079 TFormulaPrimitive(const char *name,const char *formula, GenFuncG fpointer,Int_t npar);
0080 TFormulaPrimitive(const char *name,const char *formula, TFunc0 fpointer);
0081 TFormulaPrimitive(const char *name,const char *formula, TFunc10 fpointer);
0082 TFormulaPrimitive(const char *name,const char *formula, TFunc110 fpointer);
0083 TFormulaPrimitive(const char *name,const char *formula, TFunc1110 fpointer);
0084 TFormulaPrimitive(const char *name,const char *formula, TFuncG fpointer);
0085 static Int_t AddFormula(TFormulaPrimitive * formula);
0086 static TFormulaPrimitive* FindFormula(const char* name);
0087 static TFormulaPrimitive* FindFormula(const char* name, const char *args);
0088 static TFormulaPrimitive* FindFormula(const char* name, UInt_t nargs);
0089 Double_t Eval(Double_t* x);
0090 Double_t Eval(TObject *o, Double_t *x);
0091 Double_t Eval(Double_t *x, Double_t *param);
0092
0093 ClassDefOverride(ROOT::v5::TFormulaPrimitive,0)
0094 };
0095
0096 }
0097
0098 }
0099
0100
0101 #endif