Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

random.cpp File Reference

#include <stdio.h>
#include <time.h>
#include "random.h"

Include dependency graph for random.cpp:

Go to the source code of this file.

Defines

#define __RANDOM_CPP
#define MODULUS   2147483647
#define MULTIPLIER   48271
#define CHECK   399268537
#define STREAMS   256
#define A256   22925
#define DEFAULT   123456789

Functions

double Random (void)
void PlantSeeds (long x)
int nextInteger (int range, const char *file, int line)
void PutSeed (long x)
void GetSeed (long *x)
void SelectStream (int index)
void TestRandom (void)

Variables

static long seed [STREAMS] = {DEFAULT}
static int stream = 0
static int initialized = 0


Define Documentation

#define __RANDOM_CPP
 

Definition at line 38 of file random.cpp.

#define A256   22925
 

Definition at line 45 of file random.cpp.

#define CHECK   399268537
 

Definition at line 43 of file random.cpp.

#define DEFAULT   123456789
 

Definition at line 46 of file random.cpp.

#define MODULUS   2147483647
 

Definition at line 41 of file random.cpp.

#define MULTIPLIER   48271
 

Definition at line 42 of file random.cpp.

#define STREAMS   256
 

Definition at line 44 of file random.cpp.


Function Documentation

void GetSeed long *  x  ) 
 

Definition at line 139 of file random.cpp.

References seed.

int nextInteger int  range,
const char *  file,
int  line
 

Definition at line 103 of file random.cpp.

References Random(), and val.

void PlantSeeds long  x  ) 
 

Definition at line 73 of file random.cpp.

References A256, initialized, MODULUS, PutSeed(), s, seed, SelectStream(), and STREAMS.

void PutSeed long  x  ) 
 

Definition at line 111 of file random.cpp.

References MODULUS, NULL, printf, and seed.

double Random void   ) 
 

Definition at line 53 of file random.cpp.

References MODULUS, MULTIPLIER, seed, and t.

void SelectStream int  index  ) 
 

Definition at line 150 of file random.cpp.

References DEFAULT, initialized, PlantSeeds(), and STREAMS.

void TestRandom void   ) 
 

Definition at line 163 of file random.cpp.

References A256, CHECK, GetSeed(), i, PlantSeeds(), printf, PutSeed(), Random(), SelectStream(), u, and Opie::MM::x.


Variable Documentation

int initialized = 0 [static]
 

Definition at line 50 of file random.cpp.

long seed[STREAMS] = {DEFAULT} [static]
 

Definition at line 48 of file random.cpp.

int stream = 0 [static]
 

Definition at line 49 of file random.cpp.


Generated on Sat Nov 5 16:57:24 2005 for OPIE by  doxygen 1.4.2