35 virtual double rand()=0;
46 #include "random_basic.h" 57 void del_gen() {
if (allocated)
delete gen;}
61 scale(s), offset(o) {gen=
new urand; allocated=
true;}
63 scale(s), offset(o) {Set_gen(g);}
65 void Set_gen(
random_gen *g) {del_gen(); gen=g; allocated=
false;}
66 template <
class T>
void new_gen(
const T& g)
67 {del_gen(); gen=
new T; allocated=
true;}
78 std::vector<double> P;
80 std::vector<double> a;
82 std::vector<double> pbase;
84 int delta(
double x,
int i) {
return int(pbase[i]*x) % base;}
85 int trunctowidth(
double x,
int w) {
return int(pbase[w]*x);}
88 double pow(
int x,
int y) {return ::pow((
double)x,y);}
94 distrand():base(10) {nsamp=10; width=3; min=0; max=1;}
95 void Init(
int argc,
char *argv[]);
96 void init(
double (*f)(
double));
110 #include "random_unuran.cd" 112 #include "random_gsl.cd" 114 #include "random_basic.cd" descriptor access to a class's privates
random generator based on the UNURAN library
arbitrary distribution generator (Marsaglia method).
Definition: random.h:76
abstract base class for representing random number generators
Definition: random.h:32
#define CLASSDESC_ACCESS(type)
add friend statements for each accessor function
Definition: classdesc_access.h:36
Represent arguments to TCL commands.
Definition: TCL_obj_base.h:138
random generator based on GNUSL implementation
serialisation for standard containers
scale and translate a random number generator
Definition: random.h:52
Definition: TCL_obj_base.h:124
_OPENMP
Definition: accessor.h:16
serialisation for dynamic structures (graphs/trees and so on)
Definition: random_basic.h:11