Common Lisp Package: MT19937

README:

FUNCTION

Public

%RANDOM-DOUBLE-FLOAT (ARG STATE)

Handle the single or double float case of RANDOM. We generate a float in [0d0, 1d0) by clobbering the mantissa of 1d0 with random bits (52 bits); this yields a number in [1d0, 2d0). Then 1d0 is subtracted.

%RANDOM-SINGLE-FLOAT (ARG STATE)

Handle the single or double float case of RANDOM. We generate a float in [0f0, 1f0) by clobbering the mantissa of 1f0 with random bits (23 bits); this yields a number in [1f0, 2f0). Then 1f0 is subtracted.

INIT-RANDOM-STATE (&OPTIONAL (SEED 5489) STATE)

Generate an random state vector from the given SEED. The seed can be either an integer or a vector of (unsigned-byte 32)

MAKE-RANDOM-STATE (&OPTIONAL STATE)

Make a random state object. If STATE is not supplied, return a copy of the default random state. If STATE is a random state, then return a copy of STATE. If STATE is T then return a random state generated from the universal time. To make a random state from an integer seed, try ``(make-random-object :state (init-random-state <seed>))''.

RANDOM (ARG &OPTIONAL (STATE *RANDOM-STATE*))

Generates a uniformly distributed pseudo-random number greater than or equal to zero and less than Arg. State, if supplied, is the random state to use.

Undocumented

RANDOM-CHUNK (STATE)

RANDOM-STATE-P (OBJECT)

Private

%RANDOM-INTEGER (ARG STATE)

Generates an integer greater than or equal to zero and less than Arg. Successive chunks are concatenated without overlap to construct integers larger than a single chunk. The return value has this property: If two integers are generated from the same state with Arg equal to 2^m and 2^n, respectively, then bit k is the same in both integers for 0 <= k < min(m,n). Each call to %RANDOM-INTEGER consumes at least one chunk; bits left over from previous chunks are not re-used.

RANDOM-STATE-STATE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

COPY-RANDOM-STATE (INSTANCE)

GENERATE-SEED

INT-INIT-RANDOM-STATE (&OPTIONAL (SEED 5489) STATE)

MAKE-RANDOM-OBJECT (&KEY ((STATE DUM117) (INIT-RANDOM-STATE)))

RANDOM-MT19937-UPDATE (STATE)

SETFRANDOM-STATE-STATE (NEW-VALUE INSTANCE)

VEC-INIT-RANDOM-STATE (KEY &OPTIONAL STATE)

VARIABLE

Public

Undocumented

*RANDOM-STATE*

CLASS

Public

Undocumented

RANDOM-STATE

CONSTANT

Private

Undocumented

MT19937-B

MT19937-C

MT19937-LOWER-MASK

MT19937-M

MT19937-N

MT19937-UPPER-MASK

RANDOM-CHUNK-LENGTH