[ThinAir Home]

ThinAir
A Pseudo-Random Number Generator Class Library
Version 0.9b

Table of Contents

1 Introduction
2 Quick Start
3 Characteristics of Random Number Sequences
3.1 Distribution
3.2 Range
3.3 Type
3.4 Period
3.5 Coverage
3.6 Runs
3.7 Serial Correlation
3.8 Permutations
3.9 Spectral Characteristics
4 Choosing a Random Number Generator
4.1 Instant Gratification
4.2 A little bit of work
4.3 Willing to work for it
5 The Class Interfaces
5.1 The RandomGenerator Interface
5.2 The rand() Interface
5.3 The Function Object Interface
5.3.1 RNGFuncAdaptor
5.3.2 RNGFuncAdaptorFloat
5.3.3 RNGFuncAdaptorLimit
5.3.4 RNGFuncAdaptorPercentLikely
5.3.5 RNGFuncAdaptorRange
6 Abstract Classes
6.1 RandomGenerator
6.2 CongruentialRandGen
6.3 TableRandGen
6.4 TextTableRandGen
6.5 ByteTableRandGen
6.6 CombineRandGen
6.7 AdaptorRandGen
6.8 SHARandGen
7 Concrete Classes
7.1 LinConRandGen
7.2 LinConModRandGen
7.3 MultConRandGen
7.4 MultConModRandGen
7.5 SecConRandGen
7.6 SecConModRandGen
7.7 InvConModRandGen
7.8 InvConRandGen
7.9 QuadConRandGen
7.10 NumberTableRandGen
7.11 BinaryTableRandGen
7.12 DecimalTableRandGen
7.13 HexTableRandGen
7.14 DifferenceRandGen
7.15 ShuffledMRandGen
7.16 A15BitRandGen
7.17 LaggedFibonacciRandGen
7.18 LaggedFibonacciModRandGen
7.19 LinMultWCarryRandGen
8 Generator Instantiations
8.1 BorlandRandGen
8.2 StdCRandGen
8.3 BoroshNiederreiterRandGen
8.4 WatermanRandGen
8.5 MarsagliaMCRandGen
8.6 LavauxJanssensRandGen
8.7 Knuth28RandGen
8.8 Knuth22RandGen
8.9 Knuth27RandGen
8.10 MitchellMooreRandGen
9 Special Generators
9.1 DwyerRandGen
9.2 CompilerRandGen
9.3 SHACtrRandGen
9.4 SHARngRandGen
10 Bad Pseudo-Random Number Generators
10.1 ConstantRandGen
10.2 CounterRandGen
10.3 SawtoothRandGen
10.4 SquareRandGen
10.5 RANDURandGen
10.6 FibonacciRandGen
11 Testing a Generator
12 Utility Functions and Classes
12.1 The Secure Hash Algorithm
12.2 The Modulus Arithmetic Functions
12.3 The RingBuffer class
13 Defining New Generators
13.1 General Design Considerations
13.2 Instantiating a new concrete generator
13.3 The RNGFuncAdaptorRange Function Object
13.4 Minor Modifications to a generator
13.5 Deriving the Quadratic Congruential generator
13.6 Creating a generator from scratch


Bibliography

  1. James O. Coplien. Advanced C++: Programming Styles and Idioms. Addison-Wesley, Reading, MA, USA, 1992.
  2. Jerry Dwyer. Quick and portable random number generators. C/C++ Users Journal, pages 33--44, June 1995.
  3. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns. Addison-Wesley Professional Computing Series. Addison-Wesley, Reading, MA, USA, 1995.
  4. Donald E. Knuth. Seminumerical Algorithms, volume 2 of The Art of Computer Programming. Addison-Wesley, Reading, MA, USA, second edition, 10 January 1981.
  5. David R. Musser and Atul Saini. STL Tutorial and Reference Guide. Addison-Wesley, Reading, MA, USA, 1996.
  6. Random chapter. http://csep1.phy.ornl.gov/rn/rn.html, December 1994.
  7. Herbert Schildt. The Annotated ANSI C Standard. Osborne McGraw-Hill, Berkeley, CA, 94710, USA, 1990. Contains the entire ANSI/ISO 9899-1990 Standards document.
  8. Bruce Schneier. Applied Cryptography. John Wiley & Sons, Inc., New York, NY 10158-0012, USA, second edition, 1996.
  9. Specification for a secure hash standard (shs). Federal Information Processing Standards Publication, January 1992.
  10. Andreas Weingartener. Nonlinear congruential pseudorandom number generators. Master's thesis, Universität Salzburg, June 1994.


For further information, contact G. Wade Johnson (gwadej@anomaly.org).

© 1997 G. Wade Johnson. All rights reserved.
http://www.anomaly.org/ThinAir/random.html