Next version of JABA
[jabaws.git] / binaries / src / clustalw / src / tree / RandomGenerator.h
1 /**
2  * Author: Mark Larkin
3  * 
4  * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.  
5  */
6 /*
7  *
8  *  RandomGenerator
9  *
10  *  -linear and additive congruential random number generators
11  *  (see R. Sedgewick, Algorithms, Chapter 35)
12  *
13  *  Implementation: R. Fuchs, EMBL Data Library, 1991
14  *
15  */
16 #ifndef RANDOMGENERATOR_H
17 #define RANDOMGENERATOR_H
18
19 namespace clustalw
20 {
21
22 class RandomGenerator
23 {
24     public:
25         /* Functions */
26         RandomGenerator(unsigned long s);
27         unsigned long addRand(unsigned long r);
28
29         /* Attributes */
30
31     private:
32         /* Functions */
33         unsigned long mult(unsigned long p, unsigned long q);
34
35         /* Attributes */
36         unsigned long j;
37         unsigned long a[55];
38         unsigned long m;
39         unsigned long m1;
40 };
41
42 }
43 #endif