gjrand 是一个C语言的伪随机数生成器。伪随机数的意思是在这个随机数并不保证是真正的随机,只适合一些对随机要求不是很高的场合,例如游戏和类似用途,而不适合一些对随机性要求非常高的应用,例如彩票和高安全性的随机码生成。
gjrand 3.4.0发行说明:
gjrand is a programmer's library for pseudo-random numbers. gjrand library includes random number generator testing code and is intended for simulation, games, and "Monte-C++arlo" algorithms.
It produces pseudo-random numbers of the types: uniform integers, uniform reals, normally distributed reals, binomial, Poisson, integer permutation, chi-squared distribution, and spherical distribution.
The library provides API calls for the following:
· seed the generator
· save and restore state
· generate integer uniform random numbers
· generate integer special: coins, biased coins, dice, shuffle, poisson
· generate floating point uniform numbers
· generate floating point special:
normal distribution
chi-square distribution
in a n-dimensional sphere
on the surface of a n-dimensional sphere
· compatibility functions for rand() family and rand48() family.
· Except for most of the compatibility functions, gjrand should be thread-safe. It is written in C, but appears to also be legal C++.
· There are also test programs that test all of the above and could also be used or adapted to test other alleged random sources. Some alternative (mostly bad) pseudo random generators are also provided so you can amuse yourself by watching tests fail.
下载地址:http://sourceforge.net/projects/gjrand/files/gjrand/gjrand.3.4.0/gjrand-3.4.0.tar.bz2/download