gsl_random_generator.h

Go to the documentation of this file.
00001 
00002 
00003 //
00013 
00014 //  This random generator class has been adapted from the gslwrap project.
00015 //  It is a C++ wrapper for the GNU Scientific Library
00016 //  Copyright (C) 2001 Ramin Nakisa
00017 
00018 //  This program is free software; you can redistribute it and/or modify
00019 //  it under the terms of the GNU General Public License as published by
00020 //  the Free Software Foundation; either version 2 of the License, or
00021 //  (at your option) any later version.
00022 
00023 //  This program is distributed in the hope that it will be useful,
00024 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 //  GNU General Public License for more details.
00027 
00028 //  You should have received a copy of the GNU General Public License
00029 //  along with this program; if not, write to the Free Software
00030 //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00031 
00032 #ifndef _GSL_RANDOM_GENERATOR_H
00033 #define _GSL_RANDOM_GENERATOR_H
00034 
00035 # include <stdio.h>
00036 # include <stdlib.h>
00037 #include <gsl/gsl_rng.h>
00038 #include <string>
00039 
00040 using std::string;
00041 
00043 //
00044 
00045 class random_generator 
00046 {
00047 
00048 private:
00049 
00051 
00052 gsl_rng* generator;
00053         
00054 public:
00055 
00057 //
00061 
00062 random_generator (const random_generator& other);
00063         
00065 //
00070 //
00071 
00072 random_generator (const gsl_rng_type* type=NULL, unsigned long int seed=0);
00073 
00075 //
00077 //
00078 
00079 ~random_generator ();
00080 
00082 //
00090 
00091 void set(unsigned long int seed);
00092 
00095 // @param n integer whose role is described below
00101 //
00102 
00103 unsigned long int get(unsigned long int n=0);
00104 
00106 //
00112 //
00113 
00114 double uniform();
00115 
00117 //
00121 //
00122         
00123 double uniform_positive(); 
00124 
00126 //
00133 //
00134 
00135 unsigned long int uniform_int(unsigned long int n) ;    
00136 
00140 
00141         string name();
00142         
00144 //
00145 
00146         unsigned long int max();
00147 
00149 //
00152 //
00153 
00154         unsigned long int min();
00155         
00156 };
00157 
00158 #endif // GSL_RANDOM_GENERATOR_H
00159 
All Classes Files Functions Variables Typedefs Friends Defines