rand.splitmix64 #

struct SplitMix64RNG #

struct SplitMix64RNG {
mut:
	state     u64 = seed.time_seed_64()
	has_extra bool
	extra     u32
}

SplitMix64RNG ported from http://xoshiro.di.unimi.it/splitmix64.c

fn (SplitMix64RNG) seed #

fn (mut rng SplitMix64RNG) seed(seed_data []u32)

seed sets the seed of the accepting SplitMix64RNG to the given data in little-endian format (i.e. lower 32 bits are in [0] and higher 32 bits in [1]).

fn (SplitMix64RNG) u32 #

fn (mut rng SplitMix64RNG) u32() u32

u32 updates the PRNG state and returns the next pseudorandom u32.

fn (SplitMix64RNG) u64 #

fn (mut rng SplitMix64RNG) u64() u64

u64 updates the PRNG state and returns the next pseudorandom u64.

fn (SplitMix64RNG) u32n #

fn (mut rng SplitMix64RNG) u32n(bound u32) u32

u32n returns a pseudorandom u32 less than bound.

fn (SplitMix64RNG) u64n #

fn (mut rng SplitMix64RNG) u64n(bound u64) u64

u64n returns a pseudorandom u64 less than bound.

fn (SplitMix64RNG) u32_in_range #

fn (mut rng SplitMix64RNG) u32_in_range(min u32, max u32) u32

u32n returns a pseudorandom u32 value that is guaranteed to be in range [min, max).

fn (SplitMix64RNG) u64_in_range #

fn (mut rng SplitMix64RNG) u64_in_range(min u64, max u64) u64

u64n returns a pseudorandom u64 value that is guaranteed to be in range [min, max).

fn (SplitMix64RNG) int #

fn (mut rng SplitMix64RNG) int() int

int returns a pseudorandom 32-bit (possibly negative) int.

fn (SplitMix64RNG) i64 #

fn (mut rng SplitMix64RNG) i64() i64

i64 returns a pseudorandom 64-bit (possibly negative) i64.

fn (SplitMix64RNG) int31 #

fn (mut rng SplitMix64RNG) int31() int

int31 returns a positive pseudorandom 31-bit int.

fn (SplitMix64RNG) int63 #

fn (mut rng SplitMix64RNG) int63() i64

int63 returns a positive pseudorandom 63-bit i64.

fn (SplitMix64RNG) intn #

fn (mut rng SplitMix64RNG) intn(max int) int

intn returns a pseudorandom int in range [0, max).

fn (SplitMix64RNG) i64n #

fn (mut rng SplitMix64RNG) i64n(max i64) i64

i64n returns a pseudorandom i64 in range [0, max).

fn (SplitMix64RNG) int_in_range #

fn (mut rng SplitMix64RNG) int_in_range(min int, max int) int

int_in_range returns a pseudorandom int in range [min, max).

fn (SplitMix64RNG) i64_in_range #

fn (mut rng SplitMix64RNG) i64_in_range(min i64, max i64) i64

i64_in_range returns a pseudorandom i64 in range [min, max).

fn (SplitMix64RNG) f32 #

fn (mut rng SplitMix64RNG) f32() f32

f32 returns a pseudorandom f32 value in range [0, 1).

fn (SplitMix64RNG) f64 #

fn (mut rng SplitMix64RNG) f64() f64

f64 returns a pseudorandom f64 value in range [0, 1).

fn (SplitMix64RNG) f32n #

fn (mut rng SplitMix64RNG) f32n(max f32) f32

f32n returns a pseudorandom f32 value in range [0, max).

fn (SplitMix64RNG) f64n #

fn (mut rng SplitMix64RNG) f64n(max f64) f64

f64n returns a pseudorandom f64 value in range [0, max).

fn (SplitMix64RNG) f32_in_range #

fn (mut rng SplitMix64RNG) f32_in_range(min f32, max f32) f32

f32_in_range returns a pseudorandom f32 in range [min, max).

fn (SplitMix64RNG) f64_in_range #

fn (mut rng SplitMix64RNG) f64_in_range(min f64, max f64) f64

i64_in_range returns a pseudorandom i64 in range [min, max).

fn (SplitMix64RNG) free #

unsafe
fn (mut rng SplitMix64RNG) free()

free should be called when the generator is no longer needed