source: issm/trunk-jpl/src/c/shared/Random/randomgenerator.h@ 26602

Last change on this file since 26602 was 26602, checked in by bulthuis, 3 years ago

CHG: add member functions for random generators in a separate file

  • Property svn:executable set to *
File size: 945 bytes
Line 
1/*!\file: randomgenerator.h
2 * \brief prototypes for randomgenerator.h
3 */
4
5#ifndef _RANDOMGENERATOR_H_
6#define _RANDOMGENERATOR_H_
7
8#undef M_PI
9#define M_PI 3.141592653589793238462643
10
11class rnd_uniform_distribution
12{
13
14 private:
15 int a;
16 int c;
17 unsigned int m;
18 unsigned _seed;
19 double lbound;
20 double ubound;
21
22 public:
23
24 /*constructors, destructors: */
25 rnd_uniform_distribution();
26 rnd_uniform_distribution(double a_1,double a_2);
27 ~rnd_uniform_distribution();
28
29 void seed( unsigned int s );
30 unsigned int get_seed();
31 double generator();
32
33};
34
35class rnd_normal_distribution
36{
37
38 private:
39 unsigned _seed;
40 double mean;
41 double sdev;
42
43 public:
44
45 /*constructors, destructors: */
46 rnd_normal_distribution();
47 rnd_normal_distribution(double m,double s);
48 ~rnd_normal_distribution();
49
50 void seed( unsigned int s );
51 double generator();
52
53};
54
55#endif //ifndef _RANDOMGENERATOR_H_
Note: See TracBrowser for help on using the repository browser.