-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgauss.h
More file actions
24 lines (18 loc) · 725 Bytes
/
gauss.h
File metadata and controls
24 lines (18 loc) · 725 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
/*
gauss.h - header file for Gaussian Random Number Generator
Donald H. House July 1, 1982
conversion to C -- Nov. 30, 1989
tweaks to make C++ compatible -- Aug. 26, 2005
This function takes as parameters real valued mean and standard-deviation,
and an integer valued seed. It returns a real number which may be
interpreted as a sample of a normally distributed (Gaussian) random
variable with the specified mean and standard deviation.
After the first call to gauss, the seed parameter is ignored.
Your program must #include <cmath>, and link -lm
*/
#ifndef _GAUSS_H
#define _GAUSS_H
#include <cmath>
#include <stdlib.h>
double gauss(double mean, double std, int seed);
#endif