原始连接:
http://www.agner.org/random/
This page contains software libraries for some very good random number generators.
The basic random number generators make floating point or integer random numbers with uniform distributions. This code is available in C++ and assembly language.
The non-uniform random number generators make random variates with the following distributions:
normal, bernoulli, poisson, binomial, hypergeometric, Wallenius' and Fisher's noncentral hypergeometric, multinomial, multivariate hypergeometric, Wallenius' and Fisher's multivariate noncentral hypergeometric, and shuffling. This code is available in C++ language.
Code examples are included, showing how to use these software libraries.
The uniform random number generators are also available as ready-to-use library files which can be linked into projects in many different programming languages under Windows, Linux, BSD and other operating systems on the PC platform. These libraries are coded in assembly language for improved speed.
These generators are intended for Monte Carlo applications, not for cryptographic applications.
Download packages:
- Uniform random number generators in C++
- Description: C++ class library containing the following random number generators: Mersenne twister, Mother-of-all and RANROT. Can generate floating point or integer random numbers with uniform distribution, and random bits. Very good randomness, high resolution, extremely long cycle lengths, and high speed. Example included.
System requirements: Any C++ compiler, any operating system.
Further description and instructions
Theory and description of RANROT generator
Description of Mother-of-all generator
File name: randomc.zip, size: 16538, last modified: 2005-Nov-06.
Download C++ random number generators.
- Uniform random number generators in assembly language
- Description: Library containing the same random number generators as above, but coded in assembly language for improved speed. Available as static or dynamic link library in several different file formats to support different programming languages and operating systems. Source code and examples are included.
System requirements: Windows 95 or later, Linux, BSD, and other operating systems running on a system with a 32-bit Intel, AMD or compatible microprocessor, such as the standard PC platform. Several different programming languages and environments are supported (Java is not supported yet).
Further description and instructions.
File name: randoma.zip, size: 71357, last modified: 2005-Nov-06.
Download assembly language random number generators.
- Non-uniform random number generators in C++
- Description:C++ class library generating random numbers with the following distributions: normal, bernoulli, poisson, binomial, hypergeometric, Wallenius' and Fisher's noncentral hypergeometric, multinomial, multivariate hypergeometric, and multivariate Fisher's and Wallenius' noncentral hypergeometric distributions. A function for shuffling numbers is also included, as well as C++ examples showing how to use these functions.
Most of the functions are fast and accurate, even for extreme values of the parameters.
You have the choice of using any of the uniform random number generators listed above (C++ or assembly) as base for these non-uniform random number generators.
Further description and instructions.
- Definition of distributions pdf format.
Wallenius' noncentral hypergeometric distribution pdf format.
Theoretical description of sampling methods used pdf format.
File name: stocc.zip, size: 180600, last modified: 2005-Nov-06.
Download non-uniform random number generators.
- Simulating evolution
- Description: C++ examples showing how to simulate biological evolution using the non-uniform random number generators mentioned above.
Further description and instructions.
File name: evolc.zip, size: 127795, last modified: 2005-Nov-06.
Download evolution examples.
Advanced simulation program Altruist.
- List of random numbers
- Description: A list of 10000 random numbers generated with a combined generator.
File name: 10000ran.zip, size: 49098, last modified: 2005-May-24.
Download 10000 random numbers.
If you don't know how to unpack the zip files click here.
Comments to the theory of these random number generators can be posted to my discussion board.
Follow my research on the noncentral hypergeometric distributions.
Please don't mail me with your programming problems. Your mail will not be answered.
Links to related sites