packages feed

HROOT-math-0.10.0.1: csrc/HROOTMathTRandom.h

#ifdef __cplusplus
extern "C" {
#endif

#pragma once


#include "HROOT-mathType.h"

#include "HROOTCoreTNamed.h"

#include "HROOTCoreTObject.h"

#include "STDDeletable.h"

#include "HROOT-coreType.h"


#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 );


#define TRANDOM_DECL_NONVIRT(Type) \
Type##_p Type##_newTRandom ( int seed );


#define TRANDOM_DECL_ACCESSOR(Type) \



#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);\
}


#define TRANDOM_DEF_NONVIRT(Type) \
Type##_p Type##_newTRandom ( int seed ) {\
Type* newp=new Type(seed);return from_nonconst_to_nonconst<Type##_t, Type>(newp);\
}


#define TRANDOM_DEF_ACCESSOR(Type) \



TNAMED_DECL_VIRT(TRandom)
TOBJECT_DECL_VIRT(TRandom)
DELETABLE_DECL_VIRT(TRandom)
TRANDOM_DECL_VIRT(TRandom)
TRANDOM_DECL_NONVIRT(TRandom)
TRANDOM_DECL_ACCESSOR(TRandom)

#ifdef __cplusplus
}
#endif