#ifdef __cplusplus extern "C" { #endif #ifndef __HROOT_HIST__TFormula__ #define __HROOT_HIST__TFormula__ #include "HROOT-histType.h" #include "HROOTCoreTNamed.h" #include "HROOTCoreTObject.h" #include "HROOTCoreDeletable.h" #include "HROOT-coreType.h" #undef TFORMULA_DECL_VIRT #define TFORMULA_DECL_VIRT(Type) \ int Type ## _Compile ( Type ## _p p, const char* expression ); \ void Type ## _Clear ( Type ## _p p, const char* option ); \ double Type ## _DefinedValue ( Type ## _p p, int code ); \ double Type ## _Eval ( Type ## _p p, double x, double y, double z, double t ); \ double Type ## _EvalParOld ( Type ## _p p, double * x, double * params ); \ double Type ## _EvalPar ( Type ## _p p, double * x, double * params ); \ int Type ## _GetNdim ( Type ## _p p ); \ int Type ## _GetNpar ( Type ## _p p ); \ int Type ## _GetNumber ( Type ## _p p ); \ int Type ## _GetParNumber ( Type ## _p p, const char* name ); \ int Type ## _IsLinear ( Type ## _p p ); \ int Type ## _IsNormalized ( Type ## _p p ); \ void Type ## _SetNumber ( Type ## _p p, int number ); \ void Type ## _SetParameter ( Type ## _p p, const char* name, double parvalue ); \ void Type ## _SetParameters ( Type ## _p p, double * params ); \ void Type ## _SetParName ( Type ## _p p, int ipar, const char* name ); \ void Type ## _SetParNames ( Type ## _p p, const char* name0, const char* name1, const char* name2, const char* name3, const char* name4, const char* name5, const char* name6, const char* name7, const char* name8, const char* name9, const char* name10 ); \ void Type ## _Update ( Type ## _p p ) #undef TFORMULA_DECL_NONVIRT #define TFORMULA_DECL_NONVIRT(Type) \ Type ## _p Type ## _newTFormula ( const char* name, const char* formula ); \ void Type ## _tFormulaOptimize ( Type ## _p p ); \ double Type ## _tFormulaGetParameter ( Type ## _p p, const char* name ) #undef TFORMULA_DEF_VIRT #define TFORMULA_DEF_VIRT(Type)\ int Type ## _Compile ( Type ## _p p, const char* expression )\ {\ return TYPECASTMETHOD(Type,Compile,TFormula)(p)->Compile(expression);\ }\ void Type ## _Clear ( Type ## _p p, const char* option )\ {\ TYPECASTMETHOD(Type,Clear,TFormula)(p)->Clear(option);\ }\ double Type ## _DefinedValue ( Type ## _p p, int code )\ {\ return TYPECASTMETHOD(Type,DefinedValue,TFormula)(p)->DefinedValue(code);\ }\ double Type ## _Eval ( Type ## _p p, double x, double y, double z, double t )\ {\ return TYPECASTMETHOD(Type,Eval,TFormula)(p)->Eval(x, y, z, t);\ }\ double Type ## _EvalParOld ( Type ## _p p, double * x, double * params )\ {\ return TYPECASTMETHOD(Type,EvalParOld,TFormula)(p)->EvalParOld(x, params);\ }\ double Type ## _EvalPar ( Type ## _p p, double * x, double * params )\ {\ return TYPECASTMETHOD(Type,EvalPar,TFormula)(p)->EvalPar(x, params);\ }\ int Type ## _GetNdim ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,GetNdim,TFormula)(p)->GetNdim();\ }\ int Type ## _GetNpar ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,GetNpar,TFormula)(p)->GetNpar();\ }\ int Type ## _GetNumber ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,GetNumber,TFormula)(p)->GetNumber();\ }\ int Type ## _GetParNumber ( Type ## _p p, const char* name )\ {\ return TYPECASTMETHOD(Type,GetParNumber,TFormula)(p)->GetParNumber(name);\ }\ int Type ## _IsLinear ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,IsLinear,TFormula)(p)->IsLinear();\ }\ int Type ## _IsNormalized ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,IsNormalized,TFormula)(p)->IsNormalized();\ }\ void Type ## _SetNumber ( Type ## _p p, int number )\ {\ TYPECASTMETHOD(Type,SetNumber,TFormula)(p)->SetNumber(number);\ }\ void Type ## _SetParameter ( Type ## _p p, const char* name, double parvalue )\ {\ TYPECASTMETHOD(Type,SetParameter,TFormula)(p)->SetParameter(name, parvalue);\ }\ void Type ## _SetParameters ( Type ## _p p, double * params )\ {\ TYPECASTMETHOD(Type,SetParameters,TFormula)(p)->SetParameters(params);\ }\ void Type ## _SetParName ( Type ## _p p, int ipar, const char* name )\ {\ TYPECASTMETHOD(Type,SetParName,TFormula)(p)->SetParName(ipar, name);\ }\ void Type ## _SetParNames ( Type ## _p p, const char* name0, const char* name1, const char* name2, const char* name3, const char* name4, const char* name5, const char* name6, const char* name7, const char* name8, const char* name9, const char* name10 )\ {\ TYPECASTMETHOD(Type,SetParNames,TFormula)(p)->SetParNames(name0, name1, name2, name3, name4, name5, name6, name7, name8, name9, name10);\ }\ void Type ## _Update ( Type ## _p p )\ {\ TYPECASTMETHOD(Type,Update,TFormula)(p)->Update();\ } #undef TFORMULA_DEF_NONVIRT #define TFORMULA_DEF_NONVIRT(Type)\ Type ## _p Type ## _newTFormula ( const char* name, const char* formula )\ {\ Type * newp = new Type (name, formula); \ return to_nonconst(newp);\ }\ void Type ## _tFormulaOptimize ( Type ## _p p )\ {\ TYPECASTMETHOD(Type,tFormulaOptimize,TFormula)(p)->Optimize();\ }\ double Type ## _tFormulaGetParameter ( Type ## _p p, const char* name )\ {\ return TYPECASTMETHOD(Type,tFormulaGetParameter,TFormula)(p)->GetParameter(name);\ } TNAMED_DECL_VIRT(TFormula); TOBJECT_DECL_VIRT(TFormula); DELETABLE_DECL_VIRT(TFormula); TFORMULA_DECL_VIRT(TFormula); TFORMULA_DECL_NONVIRT(TFormula); #endif // __HROOT_HIST__TFormula__ #ifdef __cplusplus } #endif