mt19937

API Reference

mt19937

Portable MT19937 Mersenne Twister random number generator

MT19937

  • Function 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)
  • Struct RANDOM-STATE
    STATE
  • Function RANDOM-STATE-P (object)
  • Variable *RANDOM-STATE*
    (mt19937::make-random-object)
  • Function 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>))''.
  • Function RANDOM-CHUNK (state)
  • Function %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.
  • Function %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.
  • Function 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.