00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00020 #ifndef __Normal_h
00021 #define __Normal_h
00022
00023 #include "CRandVar.extern.h"
00024 #include "Random.h"
00025
00026
00027 #ifdef SWIG
00028 class Normal: public externCRandVar {
00029 #else
00030 class UTILIB_API Normal: public externCRandVar {
00031 #endif
00032
00033 public:
00034
00036 Normal(RNG *_gen=0, double _mean=0.0, double _stddev=1.0);
00037
00039 double mean;
00041 double stddev;
00042
00043 protected:
00044
00046 double eval_c_func();
00047
00048 };
00049
00050
00051 #ifndef SWIG
00052 inline Normal::Normal(RNG *_gen, double _mean, double _stddev)
00053 :externCRandVar(_gen)
00054 {
00055 mean = _mean;
00056 stddev = _stddev;
00057 }
00058
00059
00060 inline double Normal::eval_c_func()
00061 { return rnorm(mean,stddev); }
00062 #endif // SWIG
00063
00064 #endif