00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00022 #ifndef __CRandVar_h
00023 #define __CRandVar_h
00024
00025 #ifndef ANSI_HDRS
00026 #include <math.h>
00027 #else
00028 #include <cmath>
00029 #endif
00030 #include "errmsg.h"
00031 #include "RNG.h"
00032
00033
00034 #ifdef SWIG
00035 class CRandVar {
00036 #else
00037 class UTILIB_API CRandVar {
00038 #endif
00039
00040 public:
00041
00043 CRandVar(RNG *generator);
00044 #ifndef SWIG
00045
00046 virtual double operator()() = 0;
00047 #endif
00048
00050 RNG *generator();
00052 void generator(RNG *p);
00053
00054 protected:
00055
00057 RNG *pGenerator;
00058
00059 };
00060
00061
00062 #ifndef SWIG
00063 inline CRandVar::CRandVar(RNG *gen)
00064 { pGenerator = gen; }
00065
00066 inline RNG *CRandVar::generator()
00067 { return(pGenerator); }
00068
00069 inline void CRandVar::generator(RNG *p)
00070 { pGenerator = p; }
00071 #endif
00072
00073 #endif