genrand.h File Reference

High performance prortable random generator created by Takuji Nishimura and Makoto Matsumoto. More...

`#include <stdio.h>`
`#include <sphinxbase/sphinxbase_export.h>`

Go to the source code of this file.

## Macros

#define | S3_RAND_MAX_INT32 0x7fffffff
#define | s3_rand_seed(s) genrand_seed(s);
| Macros to simplify calling of random generator function.
#define | s3_rand_int31() genrand_int31()
#define | s3_rand_real() genrand_real3()
#define | s3_rand_res53() genrand_res53()

## Functions

SPHINXBASE_EXPORT void | genrand_seed (unsigned long s)
| Initialize the seed of the random generator.
SPHINXBASE_EXPORT long | genrand_int31 (void)
| generates a random number on [0,0x7fffffff]-interval
SPHINXBASE_EXPORT double | genrand_real3 (void)
| generates a random number on (0,1)-real-interval
SPHINXBASE_EXPORT double | genrand_res53 (void)
| generates a random number on [0,1) with 53-bit resolution

## Detailed Description

High performance prortable random generator created by Takuji Nishimura and Makoto Matsumoto.

A high performance which applied Mersene twister primes to generate random number. If probably seeded, the random generator can achieve 19937-bits period. For technical detail. Please take a look at (FIXME! Need to search for the web site.) http://www.

Definition in file genrand.h.

## Macro Definition Documentation

## s3_rand_int31

#define s3_rand_int31 | ( |  | ) | genrand_int31()

Definition at line 145 of file genrand.h.

## S3_RAND_MAX_INT32

#define S3_RAND_MAX_INT32 0x7fffffff

Definition at line 117 of file genrand.h.

## s3_rand_real

#define s3_rand_real | ( |  | ) | genrand_real3()

Definition at line 146 of file genrand.h.

## s3_rand_res53

#define s3_rand_res53 | ( |  | ) | genrand_res53()

Definition at line 147 of file genrand.h.

## s3_rand_seed

#define s3_rand_seed | ( |  | s | ) | genrand_seed(s);

Macros to simplify calling of random generator function.

Definition at line 144 of file genrand.h.

## Function Documentation

## genrand_int31()

SPHINXBASE_EXPORT long genrand_int31 | ( | void |  | ) |

generates a random number on [0,0x7fffffff]-interval

Definition at line 197 of file genrand.c.

References genrand_int31().

Referenced by genrand_int31().

## genrand_real3()

SPHINXBASE_EXPORT double genrand_real3 | ( | void |  | ) |

generates a random number on (0,1)-real-interval

Definition at line 220 of file genrand.c.

References genrand_real3().

Referenced by genrand_real3().

## genrand_res53()

SPHINXBASE_EXPORT double genrand_res53 | ( | void |  | ) |

generates a random number on [0,1) with 53-bit resolution

Definition at line 228 of file genrand.c.

References genrand_res53().

Referenced by genrand_res53().

## genrand_seed()

SPHINXBASE_EXPORT void genrand_seed | ( | unsigned long | s | ) |

Initialize the seed of the random generator.

Definition at line 130 of file genrand.c.

References genrand_seed().

Referenced by genrand_seed().