diff --git a/bitgenerators/Bitgen/ChaCha/index.html b/bitgenerators/Bitgen/ChaCha/index.html index b222ec3..810016f 100644 --- a/bitgenerators/Bitgen/ChaCha/index.html +++ b/bitgenerators/Bitgen/ChaCha/index.html @@ -1,22 +1,5 @@ -ChaCha (bitgenerators.Bitgen.ChaCha)

Module Bitgen.ChaCha

ChaCha is a 64-bit PRNG that uses a counter-based design based on the ChaCha cipher. Instances using different values of the key produce sequences. ChaCha has a period of 2^{128} and supports arbitrary advancing and jumping the sequence in increments of 2^{64}. These features allow multiple non-overlapping sequences to be generated.

The ChaCha state vector consists of a 16-element array of uint32 that capture buffered draws from the distribution, an 8-element array of uint32s holding the seed, and a 2-element array of uint64 that holds the 128-bit counter (low, high). The elements of the seed are the value provided by the user. Typical values for number of rounds are 4, 8, 12, or 20 (for high security).

ChaCha is seeded using a vector of 4 64-bit unsigned integers. By default this is provided by SeedSequence.generate_64bit_state.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_bounded_uint64 : Stdint.uint64 -> t -> Stdint.uint64 * t

next_bounded_uint64 b t Generates a random unsigned 64-bit integer in the interval [0, b). It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range [a, b), one should generate an integer in [0, b - a) using next_bounded_uint64 (b - a) t and then add a to the resulting integer to get the output in the desired range.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val initialize_full : +ChaCha (bitgenerators.Bitgen.ChaCha)

Module Bitgen.ChaCha

ChaCha is a 64-bit PRNG that uses a counter-based design based on the ChaCha cipher. Instances using different values of the key produce sequences. ChaCha has a period of 2^{128} and supports arbitrary advancing and jumping the sequence in increments of 2^{64}. These features allow multiple non-overlapping sequences to be generated.

The ChaCha state vector consists of a 16-element array of uint32 that capture buffered draws from the distribution, an 8-element array of uint32s holding the seed, and a 2-element array of uint64 that holds the 128-bit counter (low, high). The elements of the seed are the value provided by the user. Typical values for number of rounds are 4, 8, 12, or 20 (for high security).

ChaCha is seeded using a vector of 4 64-bit unsigned integers. By default this is provided by SeedSequence.generate_64bit_state.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val initialize_full : Bitgen__.Seed.SeedSequence.t -> (Stdint.uint64 * Stdint.uint64) -> int -> diff --git a/bitgenerators/Bitgen/Philox64/index.html b/bitgenerators/Bitgen/Philox64/index.html index 6bc242e..81138a2 100644 --- a/bitgenerators/Bitgen/Philox64/index.html +++ b/bitgenerators/Bitgen/Philox64/index.html @@ -21,7 +21,7 @@ SeedSequence.initialize [] |> SeedSequence.spawn 10 |> fst - |> List.map Philox64.initialize
type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_bounded_uint64 : Stdint.uint64 -> t -> Stdint.uint64 * t

next_bounded_uint64 b t Generates a random unsigned 64-bit integer in the interval [0, b). It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range [a, b), one should generate an integer in [0, b - a) using next_bounded_uint64 (b - a) t and then add a to the resulting integer to get the output in the desired range.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val initialize_ctr : + |> List.map Philox64.initialize
type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val initialize_ctr : counter:(Stdint.uint64 * Stdint.uint64 * Stdint.uint64 * Stdint.uint64) -> Bitgen__.Seed.SeedSequence.t -> t

Get the initial state of the generator using a 4-element unsigned 64-bit tuple as the bitgenerator's counter initial state as well as SeedSequence.t for the initiale state of the generator's key.

val jump : t -> t

jump t is equivalent to 2^{128} calls to Philox64.next_uint64.

diff --git a/bitgenerators/Bitgen/SFC64/index.html b/bitgenerators/Bitgen/SFC64/index.html index 82a9cfe..af99d87 100644 --- a/bitgenerators/Bitgen/SFC64/index.html +++ b/bitgenerators/Bitgen/SFC64/index.html @@ -1,19 +1,2 @@ -SFC64 (bitgenerators.Bitgen.SFC64)

Module Bitgen.SFC64

SFC64 is a 256-bit implementation of Chris Doty-Humphrey's Small Fast Chaotic PRNG. It has a few different cycles that one might be on, depending on the seed; the expected period will be about 2^{255}.

It incorporates a 64-bit counter which means that the absolute minimum cycle length is 2^{64} and that distinct seeds will not run into each other for at least 2^{64} iterations. The SFC64 state vector consists of 4 unsigned 64-bit values. The last is a 64-bit counter that increments by 1 each iteration. The input seed is processed by SeedSequence to generate the first 3 values, then the algorithm is iterated a small number of times to mix.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_bounded_uint64 : Stdint.uint64 -> t -> Stdint.uint64 * t

next_bounded_uint64 b t Generates a random unsigned 64-bit integer in the interval [0, b). It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range [a, b), one should generate an integer in [0, b - a) using next_bounded_uint64 (b - a) t and then add a to the resulting integer to get the output in the desired range.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

+SFC64 (bitgenerators.Bitgen.SFC64)

Module Bitgen.SFC64

SFC64 is a 256-bit implementation of Chris Doty-Humphrey's Small Fast Chaotic PRNG. It has a few different cycles that one might be on, depending on the seed; the expected period will be about 2^{255}.

It incorporates a 64-bit counter which means that the absolute minimum cycle length is 2^{64} and that distinct seeds will not run into each other for at least 2^{64} iterations. The SFC64 state vector consists of 4 unsigned 64-bit values. The last is a 64-bit counter that increments by 1 each iteration. The input seed is processed by SeedSequence to generate the first 3 values, then the algorithm is iterated a small number of times to mix.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

diff --git a/bitgenerators/Bitgen/Xoshiro256/index.html b/bitgenerators/Bitgen/Xoshiro256/index.html index fa4bb45..df4c723 100644 --- a/bitgenerators/Bitgen/Xoshiro256/index.html +++ b/bitgenerators/Bitgen/Xoshiro256/index.html @@ -16,4 +16,4 @@ }); //]]> -

Module Bitgen.Xoshiro256

Xoshiro256** is a 64-bit PRNG that uses a carefully constructed linear transformation. This produces a fast PRNG with excellent statistical quality. Xoshiro256** has a period of 2^{256} - 1 and supports jumping the sequence in increments of 2^{128} which allows multiple non-overlapping subsequences to be generated.

The Xoshiro256 state consists of a 4-element tuple of 64-bit unsigned integers. Xoshiro256 is seeded using either a vector of 64-bit unsigned integers. The SeedSequence module is used to generate the required 4 values as initial state.

Xoshiro256 can be used in parallel applications by calling the method Xoshiro256.jump function which advances the state as-if 2^{128} random numbers have been generated. This allows the original sequence to be split so that distinct segments can be used in each worker process.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_bounded_uint64 : Stdint.uint64 -> t -> Stdint.uint64 * t

next_bounded_uint64 b t Generates a random unsigned 64-bit integer in the interval [0, b). It returns the integer as well as the state of the generator advanced forward. To generate an integer in the range [a, b), one should generate an integer in [0, b - a) using next_bounded_uint64 (b - a) t and then add a to the resulting integer to get the output in the desired range.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val jump : t -> t

jump t is equivalent to 2^{128} calls to Xoshiro256.next_uint64; it can be used to generate 2^{128} non-overlapping subsequences for parallel computations.

+

Module Bitgen.Xoshiro256

Xoshiro256** is a 64-bit PRNG that uses a carefully constructed linear transformation. This produces a fast PRNG with excellent statistical quality. Xoshiro256** has a period of 2^{256} - 1 and supports jumping the sequence in increments of 2^{128} which allows multiple non-overlapping subsequences to be generated.

The Xoshiro256 state consists of a 4-element tuple of 64-bit unsigned integers. Xoshiro256 is seeded using either a vector of 64-bit unsigned integers. The SeedSequence module is used to generate the required 4 values as initial state.

Xoshiro256 can be used in parallel applications by calling the method Xoshiro256.jump function which advances the state as-if 2^{128} random numbers have been generated. This allows the original sequence to be split so that distinct segments can be used in each worker process.

type t

t is the state of the bitgenerator.

val next_uint64 : t -> Stdint.uint64 * t

next_uint64 t Generates a random unsigned 64-bit integer and a state of the generator advanced forward by one step.

val next_uint32 : t -> Stdint.uint32 * t

next_uint32 t Generates a random unsigned 32-bit integer and a state of the generator advanced forward by one step.

val next_double : t -> float * t

next_double t Generates a random 64 bit float and a state of the generator advanced forward by one step.

val initialize : Bitgen__.Seed.SeedSequence.t -> t

initialize s Returns the initial state of the generator. The random stream is determined by the initialization of the seed sequence s of SeedSequence.t type.

val jump : t -> t

jump t is equivalent to 2^{128} calls to Xoshiro256.next_uint64; it can be used to generate 2^{128} non-overlapping subsequences for parallel computations.