My Project
|
00001 /* 00002 $Id: GslRandGenerator.hh 1852 2007-12-27 04:20:32Z jisuzuki $ 00003 */ 00004 00005 #ifndef GSLRANDGENERATOR 00006 #define GSLRANDGENERATOR 00007 00008 #include "Header.hh" 00009 #include <gsl/gsl_rng.h> 00010 00012 00019 class GslRandGenerator { 00020 00021 private: 00022 gsl_rng *r; 00023 00024 public: 00025 GslRandGenerator(); 00033 GslRandGenerator( unsigned long seed ); 00038 ~GslRandGenerator(); 00041 unsigned long PutMin(){ return gsl_rng_min( r ); } 00044 unsigned long PutMax(){ return gsl_rng_max( r ); } 00047 unsigned long PutRand(){ return gsl_rng_get( r ); } 00049 unsigned long PutNextSeed(){ return gsl_rng_get( r ); } 00054 unsigned long PutRand( UInt4 Max ); 00061 Double PutDouble(){ return ( (Double)PutRand() ) / ( (Double)PutMax() ); } 00066 }; 00067 00068 #endif