AnimatLab
2
Test
|
#include <gpu_random.h>
Public Member Functions | |
RNG_rand48 (int seed, int _max=0) | |
initialize the RNG with seed, just as the standard srand48-function | |
void | generate (int n) |
void | generate (int n, int n_max) |
void | get (int *r, int n) |
void * | get_random_numbers () |
Static Public Attributes | |
static const unsigned int | MAX_RANGE =0x7FFFFFFF |
a rand48 random number generator. The random number generator works similar to the standard lrand48. The seed, which is normally set by srand48, here a parameter of the constructor. Random numbers are drawn in two steps:
Definition at line 42 of file gpu_random.h.
void RNG_rand48::generate | ( | int | n | ) |
generate n random numbers as 31-bit integers like lrand48
void RNG_rand48::generate | ( | int | n, |
int | n_max | ||
) |
generate n random numbers as 31-bit integers like lrand48 with user specified max value
void RNG_rand48::get | ( | int * | r, |
int | n | ||
) |
get the first n of the previously generated numbers into array r. r must be large enough to contain all the numbers, and enough numbers have to be generated before.
|
inline |
return a GPU pointer to the generated random numbers, for using them in other GPU functions.
Definition at line 91 of file gpu_random.h.