Normal.h

00001 /*  _________________________________________________________________________
00002  *
00003  *  UTILIB: A utility library for developing portable C++ codes.
00004  *  Copyright (c) 2001, Sandia National Laboratories.
00005  *  This software is distributed under the GNU Lesser General Public License.
00006  *  For more information, see the README file in the top UTILIB directory.
00007  *  _________________________________________________________________________
00008  */
00009 
00010 //
00011 // Normal.h
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