Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
@@ -0,0 +1,33 @@
Random.h - Header file for random number class
#ifndef RANDOM_H_
#define RANDOM_H_
// Random class
// This code assumes 32-bit ints,
// which are standard on modern compilers.
//
// CONSTRUCTION: with (a) no initializer or (b) an integer
// that specifies the initial state of the generator
//
// ******************PUBLIC OPERATIONS*********************
// Return a random number according to some distribution:
// int randomInt( ) --> Uniform, 1 to 2^31-1
// int random0_1( ) --> Uniform, 0 to 1
// int randomInt( int low, int high ) --> Uniform low..high
class Random
{
public:
explicit Random( int initialValue = 1 );
int randomInt( );
int randomIntWRONG( );
double random0_1( );
int randomInt( int low, int high );
private:
int state;
};
#endif