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)
| Macros to simplify calling of random generator function.
#define | s3_rand_int31()
#define | s3_rand_real()
#define | s3_rand_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 | ( |  | ) |

Value:
genrand_int31()
genrand_int31
SPHINXBASE_EXPORT long genrand_int31(void)
generates a random number on [0,0x7fffffff]-interval
Definition genrand.c:161

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 | ( |  | ) |

Value:
genrand_real3()
genrand_real3
SPHINXBASE_EXPORT double genrand_real3(void)
generates a random number on (0,1)-real-interval
Definition genrand.c:184

Definition at line 146 of file genrand.h.

## s3_rand_res53

#define s3_rand_res53 | ( |  | ) |

Value:
genrand_res53()
genrand_res53
SPHINXBASE_EXPORT double genrand_res53(void)
generates a random number on [0,1) with 53-bit resolution
Definition genrand.c:192

Definition at line 147 of file genrand.h.

## s3_rand_seed

#define s3_rand_seed | ( |  | s | ) |

Value:
genrand_seed(s);
genrand_seed
SPHINXBASE_EXPORT void genrand_seed(unsigned long s)
Initialize the seed of the random generator.
Definition genrand.c:94

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 161 of file genrand.c.

## genrand_real3()

SPHINXBASE_EXPORT double genrand_real3 | ( | void |  | ) |

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

Definition at line 184 of file genrand.c.

## genrand_res53()

SPHINXBASE_EXPORT double genrand_res53 | ( | void |  | ) |

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

Definition at line 192 of file genrand.c.

## genrand_seed()

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

Initialize the seed of the random generator.

Definition at line 94 of file genrand.c.

References genrand_seed().

Referenced by genrand_seed().