#include <BasicRandom.hh>
Public Types | |
typedef double | value_type |
typedef unsigned int | size_type |
typedef value_type * | pointer |
Public Member Functions | |
BasicRandom (int __s1=12345, int __s2=67890) | |
constructor that takes two integers to specify the seed | |
value_type | operator() () |
return a single pseudorandom double number, in the range 0.0 to 1.0 (not sure whether this range is open or closed) | |
void | operator() (size_type __n, pointer __res) |
given a pointer __res to the beginning of an array, fill that array with __n random numbers | |
void | randomize (void *__iseed) |
(re)initialize the random number generator from an array of seeds | |
void | set_status (const std::vector< int > &__iseed) |
void | get_status (std::vector< int > &__iseed) |
void | print_info (std::ostream &__os=std::cout) |
print information about the generator to the stream | |
Static Public Member Functions | |
static value_type | min () |
minimum value returned by the generator | |
static value_type | max () |
maximum value returned by the generator | |
Private Attributes | |
int | _M_iseed [2] |
Definition at line 115 of file BasicRandom.hh.
typedef double fastjet::BasicRandom< double >::value_type |
Definition at line 117 of file BasicRandom.hh.
typedef unsigned int fastjet::BasicRandom< double >::size_type |
Definition at line 118 of file BasicRandom.hh.
typedef value_type* fastjet::BasicRandom< double >::pointer |
Definition at line 119 of file BasicRandom.hh.
fastjet::BasicRandom< double >::BasicRandom | ( | int | __s1 = 12345 , |
|
int | __s2 = 67890 | |||
) | [inline, explicit] |
constructor that takes two integers to specify the seed
Definition at line 122 of file BasicRandom.hh.
value_type fastjet::BasicRandom< double >::operator() | ( | ) | [inline] |
return a single pseudorandom double number, in the range 0.0 to 1.0 (not sure whether this range is open or closed)
Definition at line 129 of file BasicRandom.hh.
References fastjet::__default_random_generator().
00129 { 00130 return 4.6566128752457969241e-10*__default_random_generator(_M_iseed); 00131 }
void fastjet::BasicRandom< double >::operator() | ( | size_type | __n, | |
pointer | __res | |||
) | [inline] |
given a pointer __res to the beginning of an array, fill that array with __n random numbers
Definition at line 135 of file BasicRandom.hh.
00135 { 00136 for(size_type __i = 0; __i < __n; __i++) 00137 __res[__i] = this -> operator()(); 00138 }
void fastjet::BasicRandom< double >::randomize | ( | void * | __iseed | ) | [inline] |
(re)initialize the random number generator from an array of seeds
Definition at line 141 of file BasicRandom.hh.
00141 { 00142 int *__new_seed = (int*) __iseed; 00143 _M_iseed[0] = __new_seed[0]; 00144 _M_iseed[1] = __new_seed[1]; 00145 }
void fastjet::BasicRandom< double >::set_status | ( | const std::vector< int > & | __iseed | ) | [inline] |
Definition at line 147 of file BasicRandom.hh.
00147 { 00148 assert(__iseed.size() >= 2); 00149 _M_iseed[0] = __iseed[0]; 00150 _M_iseed[1] = __iseed[1]; 00151 }
void fastjet::BasicRandom< double >::get_status | ( | std::vector< int > & | __iseed | ) | [inline] |
Definition at line 153 of file BasicRandom.hh.
00153 { 00154 __iseed.resize(2); 00155 __iseed[0] = _M_iseed[0]; 00156 __iseed[1] = _M_iseed[1]; 00157 }
static value_type fastjet::BasicRandom< double >::min | ( | ) | [inline, static] |
static value_type fastjet::BasicRandom< double >::max | ( | ) | [inline, static] |
void fastjet::BasicRandom< double >::print_info | ( | std::ostream & | __os = std::cout |
) | [inline] |
int fastjet::BasicRandom< double >::_M_iseed[2] [private] |
Definition at line 170 of file BasicRandom.hh.