Module Dsfmt_216091

module Dsfmt_216091: sig .. end

double precision SIMD oriented Fast Mersenne Twister pseudorandom number generator based on IEEE 754 format, with the period 2^216091 - 1 in 52 bit units.


Information

val get_id_string : unit -> string

The identification string of this generator. It calls dsfmt_get_idstring.

val dsfmt_n : int

The length of the state array in 128 bit units. Actually, one more element is used for lung. The value of DSFMT_N.

val min_float_array_length : int

The minimum length of array used for Dsfmt_216091.fill_floatarray52 and Dsfmt_216091.fill_floatarray52p1. It is the value of DSFMT_N64.

Generator

type t 

The type of the state.

Initialization

val make_int32 : int32 -> t
val make_int32_array : int32 array -> t
val make : int array -> t
val make_self_init : unit -> t
val copy : t -> t

Bit generation

val bits52 : t -> int64

Draws out 52 bits of the mantissa part without implicit 1 called economized form. The result equals to Dsfmt_216091.float_bits52 multiplied by 2^52.

val float_bits52 : t -> float

Draws out 52 bits as float [0,1). It calls dsfmt_genrand_close_open.

val float_bits52p1 : t -> float

Like Dsfmt_216091.float_bits52 except the range of value is [1,2). It calls dsfmt_genrand_close1_open2.

val fill_floatarray52 : t -> floatarray -> int -> int -> unit

Draws out 52 bit values as float [0,1) into the specified floatarray by one call. The length of the array must be at least Dsfmt_216091.min_float_array_length and a multiple of two. This can not be used after calling one of the functions drawing out an individual value. It calls dsfmt_fill_array_close_open.

val fill_floatarray52p1 : t -> floatarray -> int -> int -> unit

Like Dsfmt_216091.fill_floatarray52 except the range of values is [1,2). It calls dsfmt_fill_array_close1_open2.

Uniform distribution

val int : t -> int -> int

[0,bound). Draws out values repeatedly as needed in 52 bit units. bound must be fits into 52 bits.

val int32 : t -> int32 -> int32
val int64 : t -> int64 -> int64
val nativeint : t -> nativeint -> nativeint
val float : t -> float -> float

[0,bound), unlike Stdlib.Random.float. Draws out 52 bits once.

val bool : t -> bool

false or true. Draws out 52 bits once.

Serialization

val import : int32 array * int -> t
val export : t -> int32 array * int