#ifdef __cplusplus extern "C" { #endif #ifndef __HROOT_MATH__TRandom__ #define __HROOT_MATH__TRandom__ #include "HROOT-mathType.h" #include "HROOTCoreTNamed.h" #include "HROOTCoreTObject.h" #include "HROOTCoreDeletable.h" #include "HROOT-coreType.h" #undef TRANDOM_DECL_VIRT #define TRANDOM_DECL_VIRT(Type) \ int Type ## _GetSeed ( Type ## _p p ); \ double Type ## _Gaus ( Type ## _p p, double mean, double sigma ); \ void Type ## _SetSeed ( Type ## _p p, int seed ); \ double Type ## _Uniform ( Type ## _p p, double x1, double x2 ) #undef TRANDOM_DECL_NONVIRT #define TRANDOM_DECL_NONVIRT(Type) \ Type ## _p Type ## _newTRandom ( int seed ) #undef TRANDOM_DEF_VIRT #define TRANDOM_DEF_VIRT(Type)\ int Type ## _GetSeed ( Type ## _p p )\ {\ return TYPECASTMETHOD(Type,GetSeed,TRandom)(p)->GetSeed();\ }\ double Type ## _Gaus ( Type ## _p p, double mean, double sigma )\ {\ return TYPECASTMETHOD(Type,Gaus,TRandom)(p)->Gaus(mean, sigma);\ }\ void Type ## _SetSeed ( Type ## _p p, int seed )\ {\ TYPECASTMETHOD(Type,SetSeed,TRandom)(p)->SetSeed(seed);\ }\ double Type ## _Uniform ( Type ## _p p, double x1, double x2 )\ {\ return TYPECASTMETHOD(Type,Uniform,TRandom)(p)->Uniform(x1, x2);\ } #undef TRANDOM_DEF_NONVIRT #define TRANDOM_DEF_NONVIRT(Type)\ Type ## _p Type ## _newTRandom ( int seed )\ {\ Type * newp = new Type (seed); \ return to_nonconst(newp);\ } TNAMED_DECL_VIRT(TRandom); TOBJECT_DECL_VIRT(TRandom); DELETABLE_DECL_VIRT(TRandom); TRANDOM_DECL_VIRT(TRandom); TRANDOM_DECL_NONVIRT(TRandom); #endif // __HROOT_MATH__TRandom__ #ifdef __cplusplus } #endif