Module rand.config stdlib

rand.config
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

  • Standard Library

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct PRNGConfigStruct

params
pub struct PRNGConfigStruct {
pub:
	seed_ []u32 = seed.time_seed_array(2)
}

PRNGConfigStruct is a configuration struct for creating a new instance of the default RNG.

Note that the RNGs may have a different number of u32s required for seeding. The default generator WyRand used 64 bits, ie. 2 u32s so that is the default. In case your desired generator uses a different number of u32s, use the seed.time_seed_array() method with the correct number of u32s.

#struct NormalConfigStruct

params
pub struct NormalConfigStruct {
pub:
	mu    f64 = 0.0
	sigma f64 = 1.0
}

Configuration struct for generating normally distributed floats. The default value for mu is 0 and the default value for sigma is 1.

#struct ShuffleConfigStruct

params
pub struct ShuffleConfigStruct {
pub:
	start int
	end   int
}

Configuration struct for the shuffle functions.

The start index is inclusive and the end index is exclusive.

Set the end to 0 to shuffle until the end of the array.

#fn (ShuffleConfigStruct) validate_for[T]

fn (config ShuffleConfigStruct) validate_for(a []T) !

validate_for is a helper function for validating the configuration struct for the given array.

Interfaces

This section is empty.

Enums

This section is empty.