xsadd

package
v0.0.0-...-17533aa Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is a random source using XORSHIFT-ADD (XSadd) algorithm.

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/XSADD/index.html Go port of https://github.com/MersenneTwister-Lab/XSadd

func New

func New(state [4]uint32) *Source

New create a new source.

func (*Source) Int63

func (s *Source) Int63() int64

Int63 implements math/rand.Source.

func (*Source) Seed

func (s *Source) Seed(seed int64)

Seed implements math/rand.Source.

func (*Source) SeedBySlice

func (s *Source) SeedBySlice(initKey []uint32)

SeedBySlice initializes the state by initKey.

func (*Source) Uint32

func (s *Source) Uint32() uint32

Uint32 returns pseudo-random uint32 values in the range [0, 1<<32).

func (*Source) Uint64

func (s *Source) Uint64() uint64

Uint64 implements math/rand.Source64

Jump to

Keyboard shortcuts

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