splitmix64

package
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2019 License: ISC Imports: 0 Imported by: 0

Documentation

Overview

Package splitmix64 implements a 64 bit SplittableRandom PRNG.

This is a fixed-increment version of Java 8's SplittableRandom generator.

Period: 2^64. State size: 64 bits.

See http://dx.doi.org/10.1145/2714064.2660195 and http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html

It is a very fast generator passing BigCrush. It is used in the xoroshiro128+ and xorshift1024* generators to initialize their state arrays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rng

type Rng struct {
	State uint64 // Internal state value
}

Rng encapsulates a splitmix64 PRNG. The State value is exported so that the generator can be initialized and seeded in a single line of code:

rng := splitmix64.Rng{seed}
// is equivalent to
rng := splitmix64.Rng{}
rng.Seed(int64(seed))

func (*Rng) Int63

func (rng *Rng) Int63() int64

Int63 returns a non-negative pseudo-random 63-bit integer as an int64.

func (*Rng) Seed

func (rng *Rng) Seed(seed int64)

Seed uses the provided seed value to initialize the generator to a deterministic state.

func (*Rng) Uint64

func (rng *Rng) Uint64() uint64

Uint64 returns a pseudo-random 64-bit value as a uint64.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL