BRL-CAD

Minimal Standard RANdom number generator. More...

#include "common.h"
#include <stdio.h>
#include <math.h>
#include "bu/malloc.h"
#include "bu/log.h"
#include "vmath.h"
#include "bn/msr.h"
Include dependency graph for msr.c:

Go to the source code of this file.

Macros

#define BN_MSR_MAXTBL   4096 /* Size of random number tables. */
 
#define A   16807
 
#define M   2147483647
 
#define DM   2147483647.0
 
#define Q   127773 /* Q = M / A */
 
#define R   2836 /* R = M % A */
 

Functions

struct bn_unifbn_unif_init (long int setseed, int method)
 
long bn_unif_long_fill (struct bn_unif *p)
 
double bn_unif_double_fill (struct bn_unif *p)
 
void bn_unif_free (struct bn_unif *p)
 
struct bn_gaussbn_gauss_init (long int setseed, int method)
 
double bn_gauss_fill (struct bn_gauss *p)
 
void bn_gauss_free (struct bn_gauss *p)
 

Detailed Description

Minimal Standard RANdom number generator.

From:
Stephen K. Park and Keith W. Miller
"Random number generators: good ones are hard to find"
CACM vol 31 no 10, Oct 88

Definition in file msr.c.