Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtomicPCG ¶
type AtomicPCG struct {
PCG
}
AtomicPCG implements the PCG-XSH-RR generator with atomic state updates.
This generator is safe for concurrent use by multiple goroutines. The zero value is a valid state: Seed() can be called to set a custom seed.
type AtomicSplitMix64 ¶
type AtomicSplitMix64 struct {
SplitMix64
}
AtomicSplitMix64 implements the Java 8 SplittableRandom generator with atomic state updates.
This generator is safe for concurrent use by multiple goroutines. The zero value is a valid state: Seed() can be called to set a custom seed.
func (*AtomicSplitMix64) Seed ¶
func (r *AtomicSplitMix64) Seed(s uint64)
Seed initializes the state with the provided seed.
This function is safe for concurrent use by multiple goroutines.
func (*AtomicSplitMix64) Uint64 ¶
func (r *AtomicSplitMix64) Uint64() uint64
Uint64 returns a random uint64.
This function is safe for concurrent use by multiple goroutines.
type PCG ¶
type PCG struct {
// contains filtered or unexported fields
}
PCG implements the PCG-XSH-RR generator. This generator is not safe for concurrent use by multiple goroutines. The zero value is a valid state: Seed() can be called to set a custom seed.
type ShardedPCG ¶
type ShardedPCG struct {
// contains filtered or unexported fields
}
ShardedPCG implements the PCG-XSH-RR generator with per-thread (per-P) states.
This generator is safe for concurrent use by multiple goroutines. The zero value is a valid state, but it uses a static, all zero seed: use NewShardedPCG to instantiate a ShardedPCG with a random seed.
func NewShardedPCG ¶
func NewShardedPCG() *ShardedPCG
NewShardedPCG creates a valid ShardedPCG instance seeded using crypto/rand.
Increasing the value of GOMAXPROCS after instantiation will likely yield sub-optimal performance.
func (*ShardedPCG) Uint32 ¶
func (p *ShardedPCG) Uint32() uint32
Uint32 returns a random uint32.
This function is safe for concurrent use by multiple goroutines.
type ShardedSplitMix64 ¶
type ShardedSplitMix64 struct {
// contains filtered or unexported fields
}
ShardedSplitMix64 implements the Java 8 SplittableRandom generator with per-thread (per-P) states.
This generator is safe for concurrent use by multiple goroutines. The zero value is a valid state, but it uses a static, all zero seed: use NewShardedSplitMix64 to instantiate a ShardedSplitMix64 with a random seed.
func NewShardedSplitMix64 ¶
func NewShardedSplitMix64() *ShardedSplitMix64
NewShardedSplitMix64 creates a valid ShardedSplitMix64 instance seeded using crypto/rand.
Increasing the value of GOMAXPROCS after instantiation will likely yield sub-optimal performance.
func (*ShardedSplitMix64) Uint64 ¶
func (r *ShardedSplitMix64) Uint64() uint64
Uint64 returns a random uint64.
This function is safe for concurrent use by multiple goroutines.
type ShardedXoshiro256StarStar ¶
type ShardedXoshiro256StarStar struct {
// contains filtered or unexported fields
}
ShardedXoshiro256StarStar implements the Xoshiro256** PRNG with per-thread (per-P) states.
This generator is safe for concurrent use by multiple goroutines. The zero value is not a valid state: use NewShardedXoshiro256StarStar to construct a valid instance. Increasing the value of GOMAXPROCS after instantiation will likely yield sub-optimal performance.
func NewShardedXoshiro256StarStar ¶
func NewShardedXoshiro256StarStar() *ShardedXoshiro256StarStar
NewShardedXoshiro256StarStar creates a valid ShardedXoshiro256StarStar instance seeded using crypto/rand.
Increasing the value of GOMAXPROCS after instantiation will likely yield sub-optimal performance.
func (*ShardedXoshiro256StarStar) Uint64 ¶
func (r *ShardedXoshiro256StarStar) Uint64() uint64
Uint64 returns a random uint64.
This function is safe for concurrent use by multiple goroutines.
type SplitMix64 ¶
type SplitMix64 struct {
// contains filtered or unexported fields
}
SplitMix64 implements the Java 8 SplittableRandom generator. This generator is not safe for concurrent use by multiple goroutines. The zero value is a valid state: Seed() can be called to set a custom seed.
func (*SplitMix64) Seed ¶
func (r *SplitMix64) Seed(s uint64)
Seed initializes the state with the provided seed.
This function is not safe for concurrent use by multiple goroutines.
func (*SplitMix64) Uint64 ¶
func (r *SplitMix64) Uint64() uint64
Uint64 returns a random uint64.
This function is not safe for concurrent use by multiple goroutines.
type Xoshiro256StarStar ¶
type Xoshiro256StarStar struct {
// contains filtered or unexported fields
}
Xoshiro256StarStar implements the Xoshiro256** PRNG.
This generator is not safe for concurrent use by multiple goroutines. The zero value is not a valid state: Seed() must be called before generating random numbers.
func (*Xoshiro256StarStar) Seed ¶
func (r *Xoshiro256StarStar) Seed(s0, s1, s2, s3 uint64)
Seed sets the seed for the generator.
The seed should not be all zeros (i.e. at least one of the four uint64 should be non-zero). This function is not safe for concurrent use by multiple goroutines.
func (*Xoshiro256StarStar) Uint64 ¶
func (r *Xoshiro256StarStar) Uint64() uint64
Uint64 returns a random uint64.
This function is not safe for concurrent use by multiple goroutines.