HELP ERANDOM David Young August 1996 LIB * _______ERANDOM (for External random) generates pseudo-random numbers using an externally-loaded random number generator. This is faster than LIB * _________NEWRANDOM, and the statistical properties may be superior to those of the standard generator *random. The numbers may be drawn from a uniform or a Gaussian distribution. erandom(____spec) -> ________repeater The argument ____spec specifies the distribution of the random numbers produced by the procedure ________repeater. ____spec may be a list or vector of the form [____type __p0 __p1]. The first element, ____type, must be either the word "uniform" or the word "gaussian". In the uniform case, results are drawn from a uniform distribution on the range [__p0 __p1) - i.e. the results are greater than or equal to __p0 but less than __p1. In the gaussian case, results are drawn from a Gaussian distribution with mean __p0 and standard deviation __p1. If both __p0 and __p1 are integers and the ____type is uniform, the results are integers; otherwise they will be floating point. (So note that [uniform 0 256] produces values in the range 0 to 255 inclusive, but not including 256. See *array_hist for a rationale of this.) The word "uniform" can be used as shorthand for [uniform 0.0 1.0] and the word "gaussian" for [gaussian 0.0 1.0]. A number _x can be used as shorthand for [uniform 0 _x]. The value is equivalent to "uniform". The result ________repeater is a procedure which when called returns successive numbers from the distribution: ________repeater() -> ___num This procedure makes use of LIB * ____________ARRAY_RANDOM. See HELP *array_random for more details of the underlying procedures. Calls to erandom will affect the sequence of numbers produced by array_random, and ____vice _____versa. The generator can be set to a repeatable state, and its state saved, by assigning to or accessing array_random_seed, which is an active variable with multiplicity 3 (see *array_random). Since the numbers returned by each repeater are cached, such an assignment must be followed immediately by a call to erandom to set up any repeaters to be used, Any existing repeater which continues to be called will see the effect of the assignment after some arbitrary number of calls has exhausted its cache. --- _______________________$popvision/help/erandom --- _________Copyright __________University __of ______Sussex _____1996. ___All ______rights _________reserved.