[go: up one dir, main page]

Menu

[r353]: / libpetey / randomize.h  Maximize  Restore  History

Download this file

35 lines (22 with data), 655 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef RANDOMIZE_H
#define RANDOMIZE_H 1
//provides a simple and uniform interface for random number generation...
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
namespace libpetey {
extern gsl_rng *libpetey_ran;
unsigned long seed_from_clock();
void ran_init(const gsl_rng_type *rt=gsl_rng_mt19937);
//uniform deviates:
inline double ranu() {
return gsl_rng_uniform(libpetey_ran);
}
//gaussian deviates:
inline double rang() {
return gsl_ran_ugaussian(libpetey_ran);
}
//for permuting arrays:
long *randomize(long n);
void ran_end();
} //end namespace libpetey
#endif