Documentation
¶
Overview ¶
Package prng defines interfaces to be implemented by packages that implement PRNG engines
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine interface {
// Uint64 returns a pseudo-random 64-bit value in [0, 2^64) as a uint64.
// Uint64 advances the internal state of the engine.
Uint64() uint64
// Float64 returns a pseudo-random number in [0.0, 1.0) as a float64.
// Float64 advances the internal state of the engine.
Float64() float64
// Float64OO returns a pseudo-random number in (0.0, 1.0) as a float64.
// Float6400 advances the internal state of the engine.
Float64OO() float64
// Seed uses the provided value to initialize the engine
Seed(uint64)
// GetSeed returns the seed used to initialize the engine
GetSeed() uint64
// GetState returns the internal state of the engine as []byte
// GetState can be used to save the state, e.g. to a file
GetState() []byte
// SetState sets the internal state of the engine from a []byte
// SetState can be used to resume from a saved state
SetState([]byte)
// Reset reverts the internal state of the engine to its default state,
// except the seed
Reset()
}
Engine is an interface for a Pseudo-Random Number Generator of uniformly-distributed values
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
prngtest
Package prngtest defines utilities for testing PRNG Engines
|
Package prngtest defines utilities for testing PRNG Engines |
|
Package mt19937 implements 64-bit variant of Mersenne Twister pseudo-random number generator.
|
Package mt19937 implements 64-bit variant of Mersenne Twister pseudo-random number generator. |
|
Package splitmix64 implements SplitMix64 pseudo-random number gnerator.
|
Package splitmix64 implements SplitMix64 pseudo-random number gnerator. |
|
Package xoroshiro128plus provides implementation for xoroshiro PRNG algorithm
|
Package xoroshiro128plus provides implementation for xoroshiro PRNG algorithm |
|
Package xorshift1024star provides implementation for xorshift PRNG algorithm with multiplication as the non-linear transformation function.
|
Package xorshift1024star provides implementation for xorshift PRNG algorithm with multiplication as the non-linear transformation function. |
|
Package xorshift128plus provides implementation for xorshift PRNG algorithm with addition as the non-linear transformation function.
|
Package xorshift128plus provides implementation for xorshift PRNG algorithm with addition as the non-linear transformation function. |
Click to show internal directories.
Click to hide internal directories.