Functions | |
| int | ranset (unsigned long *seed) |
| Seed the ranlux generator from GSL. | |
| int | Par_ranset (unsigned long *seed, int iread) |
| Uses the rank to get a new seed. Copying from the FORTRAN description here c create new seeds in range seed to 9*seed c having a range of 0*seed gave an unfortunate pattern c in the underlying value of ds(1) (it was always 10 times bigger c on the last processor). This does not appear to happen with 9. | |
| int | Gauss_z (Complex *ps, unsigned int n, const Complex mu, const double sigma) |
| Generates a vector of normally distributed random double precision complex numbers using the Box-Muller Method. | |
| int | Gauss_d (double *ps, unsigned int n, const double mu, const double sigma) |
| Generates a vector of normally distributed random double precision numbers using the Box-Muller Method. | |
| int | Gauss_c (Complex_f *ps, unsigned int n, const Complex_f mu, const float sigma) |
| Generates a vector of normally distributed random single precision complex numbers using the Box-Muller Method. | |
| int | Gauss_f (float *ps, unsigned int n, const float mu, const float sigma) |
| Generates a vector of normally distributed random single precision numbers using the Box-Muller Method. | |
| int | Par_ranread (char *filename, double *ranval) |
| Reads ps from a file Since this function is very similar to Par_sread, I'm not really going to comment it check there if you are confused about things. | |
| double | Par_granf () |
| Generates a random double which is then sent to the other ranks. | |
Generates a vector of normally distributed random single precision complex numbers using the Box-Muller Method.
| [out] | ps | The output array |
| [in] | n | The array length |
| [in] | mu | mean |
| [in] | sigma | variance |
Definition at line 136 of file random.c.
References ARRAYLEN, Complex_f, I, M_PI, ranlux_instd, and seed.
| int Gauss_d | ( | double * | ps, |
| unsigned int | n, | ||
| const double | mu, | ||
| const double | sigma ) |
Generates a vector of normally distributed random double precision numbers using the Box-Muller Method.
| [out] | ps | The output array |
| [in] | n | The array length |
| [in] | mu | mean |
| [in] | sigma | variance |
Definition at line 170 of file random.c.
References ARRAYLEN, M_PI, ranlux_instd, and seed.
| int Gauss_f | ( | float * | ps, |
| unsigned int | n, | ||
| const float | mu, | ||
| const float | sigma ) |
Generates a vector of normally distributed random single precision numbers using the Box-Muller Method.
| [out] | ps | The output array |
| [in] | n | The array length |
| [in] | mu | mean |
| [in] | sigma | variance |
Definition at line 221 of file random.c.
References ARRAYLEN, M_PI, ranlux_instd, and seed.
Generates a vector of normally distributed random double precision complex numbers using the Box-Muller Method.
| [out] | ps | The output array |
| [in] | n | The array length |
| [in] | mu | mean |
| [in] | sigma | variance |
Definition at line 102 of file random.c.
References ARRAYLEN, Complex, I, M_PI, ranlux_instd, and seed.
| double Par_granf | ( | ) |
Generates a random double which is then sent to the other ranks.
Definition at line 87 of file random.c.
References Par_dcopy(), rank, ranlux_instd, and seed.
| int Par_ranread | ( | char * | filename, |
| double * | ranval ) |
Reads ps from a file Since this function is very similar to Par_sread, I'm not really going to comment it check there if you are confused about things.
| [in] | filename | The name of the file we're reading from |
| [in] | ranval | The destination for the file's contents |
Definition at line 42 of file random.c.
References OPENERROR, Par_dcopy(), and rank.
| int Par_ranset | ( | unsigned long * | seed, |
| int | iread ) |
Uses the rank to get a new seed. Copying from the FORTRAN description here c create new seeds in range seed to 9*seed c having a range of 0*seed gave an unfortunate pattern c in the underlying value of ds(1) (it was always 10 times bigger c on the last processor). This does not appear to happen with 9.
| [in] | seed | The seed from the rank in question. |
| [in] | iread | Do we read from file or not. Don't remember why it's here as it's not used |
Definition at line 64 of file random.c.
References rank, ranset(), seed, and size.
|
inline |
Seed the ranlux generator from GSL.
| [in] | seed | pointer to seed |
Definition at line 29 of file random.c.
References ranlux_instd, and seed.