Class around PixMap objects that allows more python-like access. By Joe Strout.
[python/dscho.git] / Doc / lib / libwhrandom.tex
blob8df1b772b6043c3e6b64dbe2592d8d4c85c3dc58
1 \section{\module{whrandom} ---
2 Floating point pseudo-random number generator.}
3 \declaremodule{standard}{whrandom}
5 \modulesynopsis{Floating point pseudo-random number generator.}
8 This module implements a Wichmann-Hill pseudo-random number generator
9 class that is also named \code{whrandom}. Instances of the
10 \code{whrandom} class have the following methods:
12 \begin{funcdesc}{choice}{seq}
13 Chooses a random element from the non-empty sequence \var{seq} and returns it.
14 \end{funcdesc}
16 \begin{funcdesc}{randint}{a, b}
17 Returns a random integer \var{N} such that \code{\var{a}<=\var{N}<=\var{b}}.
18 \end{funcdesc}
20 \begin{funcdesc}{random}{}
21 Returns the next random floating point number in the range [0.0 ... 1.0).
22 \end{funcdesc}
24 \begin{funcdesc}{seed}{x, y, z}
25 Initializes the random number generator from the integers
26 \var{x},
27 \var{y}
28 and
29 \var{z}.
30 When the module is first imported, the random number is initialized
31 using values derived from the current time.
32 \end{funcdesc}
34 \begin{funcdesc}{uniform}{a, b}
35 Returns a random real number \var{N} such that \code{\var{a}<=\var{N}<\var{b}}.
36 \end{funcdesc}
38 When imported, the \code{whrandom} module also creates an instance of
39 the \code{whrandom} class, and makes the methods of that instance
40 available at the module level. Therefore one can write either
41 \code{N = whrandom.random()} or:
42 \begin{verbatim}
43 generator = whrandom.whrandom()
44 N = generator.random()
45 \end{verbatim}
47 \begin{seealso}
48 \seemodule{random}{generators for various random distributions}
49 \seetext{Wichmann, B. A. \& Hill, I. D., ``Algorithm AS 183:
50 An efficient and portable pseudo-random number generator'',
51 \emph{Applied Statistics} 31 (1982) 188-190}
52 \end{seealso}