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
|
/**
* Author: Mark Larkin
*
* Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
*/
/*
*
* RandomGenerator
*
* -linear and additive congruential random number generators
* (see R. Sedgewick, Algorithms, Chapter 35)
*
* Implementation: R. Fuchs, EMBL Data Library, 1991
*
*/
#ifndef RANDOMGENERATOR_H
#define RANDOMGENERATOR_H
namespace clustalw
{
class RandomGenerator
{
public:
/* Functions */
RandomGenerator(unsigned long s);
unsigned long addRand(unsigned long r);
/* Attributes */
private:
/* Functions */
unsigned long mult(unsigned long p, unsigned long q);
/* Attributes */
unsigned long j;
unsigned long a[55];
unsigned long m;
unsigned long m1;
};
}
#endif
|