-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrgauss.h
46 lines (36 loc) · 1.04 KB
/
rgauss.h
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
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef GAUSS_H
#define GAUSS_H
// headers
#include <cmath>
#include <cstdlib>
#include <lib.h>
// definitions
// prototypes
class rgauss
{
private:
int n;
float* y;
public:
// constructor
rgauss(int nn);
// destructor
~rgauss();
// return random number with gaussian distribution. second
// call truncates from below, third trucates from below and above.
float ran(float sigma);
float ran(float sigma, float xmin);
float ran(float sigma, float xmin, float xmax);
// return array of numbers with gaussian distribution. second
// call truncates from below, third trucates from below and above.
float* ran(float sigma, int ntot);
float* ran(float sigma, int ntot, float xmin);
float* ran(float sigma, int ntot, float xmin, float xmax);
// return array of numbers with gaussian distribution. second
// call truncates from below, third trucates from below and above.
// allow the possibility of saving alpha and beta for future calls.
float* ran(
float sigma, int ntot, float xmin, float xmax,
float& alpha, float& beta);
};
#endif