Random number generator for uniform or Gaussian
Date/Time of Processing: Monday 30 May 1994 06:07:55Pm Overall Assessment of System: OK Classification of System: A Basis of Classification -- Syntax Errors PASS Completeness PASS Independence from External Libraries PASS Independence from a Specific Ada Compiler PASS Number of ... Files 4 Library Units 4 Lines 1597 Statements 170 Comments 1087
languages/ada/asr/components/ran3: File Name Size --------- ---- ran3.zip 44,131 Totals ============== ============== 1 Files 44,131
This is a collection of random "number" generator functions. There are two principal packages: Random_Unit provides floating point random numbers uniform on 0.0 .. 1.0. Random_Pkg generalizes that to produce random variables of many different types, including enumeration sets. The distribution from which the sample is taken may be uniform or Gaussian. A major design goal is machine/compiler independence. Both packages are "sequential," to use Booch's lexicon: each must be used by those programs which contain only a single thread of control. The algorithm used in Random_Unit was developed by George Marsaglia. It was then specifically programmed and tested and in Ada before publication as ``An Ada Implementation of Marsaglia's "Universal" Random Number Generator,'' M.G. Harmon and T.P. Baker, ACM Ada Letters, volume 8, number 2 (pages 110-112), March/April 1988. Random_Pkg provides the generators: Name Data Type Range a) Even a1) Uniform Float [0.0,1.0) a2) Gen_Integer Generic integer (full) a3) Gen_Float Generic float (full; digits <= 6) a4) Gen_Discrete Generic enumerated (full) b) Gaussian b1) Simplex Float (full) b2) Gen_Float Generic float (full; digits <=6) Gaussian generators can have any range, mean and standard deviation. Several test programs are included.
DATE VERSION AUTHOR HISTORY 30-Jan-91 1.0 Gralia,Hubbs and Douglas Initial Release
This prologue must be included in all copies of this software. This software is copyright by the author. This software is released to the Ada community. Restrictions on use or distribution: it may be freely copied provided the author's name and copyright notice is retained intact.
This software and its documentation are provided "AS IS" and without any expressed or implied warranties whatsoever. No warranties as to performance, merchantability, or fitness for a particular purpose exist. The user is advised to test the software thoroughly before relying on it. The user must assume the entire risk and liability of using this software. In no event shall any person or organization of people be held responsible for any direct, indirect, consequential or inconsequential damages or lost profits.