sfmt

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: 3 Imported by: 0

Documentation

Overview

The sfmt package implements SIMD-oriented Fast Mersenne Twister (SFMT): twice faster than Mersenne Twister.

http://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/SFMT/index.html

Index

Constants

This section is empty.

Variables

View Source
var Param11213 = &Parameter{
	MExp:    11213,
	Pos1:    68,
	SL1:     14,
	SL2:     3,
	SR1:     7,
	SR2:     3,
	MSK1:    0xffffffefeffff7fb,
	MSK2:    0x7fffdbfddfdfbfff,
	Parity1: 0x0000000000000001,
	Parity2: 0xd0c7afa3e8148000,
}

Param11213 xxx

View Source
var Param1279 = &Parameter{
	MExp:    1279,
	Pos1:    7,
	SL1:     14,
	SL2:     3,
	SR1:     5,
	SR2:     1,
	MSK1:    0x7fefcffff7fefffd,
	MSK2:    0xb5ffff7faff3ef3f,
	Parity1: 0x0000000000000001,
	Parity2: 0x2000000000000000,
}

Param1279 xxx

View Source
var Param132049 = &Parameter{
	MExp:    132049,
	Pos1:    110,
	SL1:     19,
	SL2:     1,
	SR1:     21,
	SR2:     1,
	MSK1:    0xfb6ebf95ffffbb5f,
	MSK2:    0xcff77ffffffefffa,
	Parity1: 0x0000000000000001,
	Parity2: 0xc7e91c7dcb520000,
}

Param132049 xxx

View Source
var Param19937 = &Parameter{
	MExp:    19937,
	Pos1:    122,
	SL1:     18,
	SL2:     1,
	SR1:     11,
	SR2:     1,
	MSK1:    0xddfecb7fdfffffef,
	MSK2:    0xbffffff6bffaffff,
	Parity1: 0x0000000000000001,
	Parity2: 0x13c9e68400000000,
}

Param19937 xxx

View Source
var Param216091 = &Parameter{
	MExp:    216091,
	Pos1:    627,
	SL1:     11,
	SL2:     3,
	SR1:     10,
	SR2:     1,
	MSK1:    0xbfffffffbff7bff7,
	MSK2:    0xffddfbfbbffffa7f,
	Parity1: 0x89e80709f8000001,
	Parity2: 0x0c64b1e43bd2b64b,
}

Param216091 xxx

View Source
var Param2281 = &Parameter{
	MExp:    2281,
	Pos1:    12,
	SL1:     19,
	SL2:     1,
	SR1:     5,
	SR2:     1,
	MSK1:    0xfdfffffebff7ffbf,
	MSK2:    0xf2f7cbbff7ffef7f,
	Parity1: 0x0000000000000001,
	Parity2: 0x41dfa60000000000,
}

Param2281 xxx

View Source
var Param4253 = &Parameter{
	MExp:    4253,
	Pos1:    17,
	SL1:     20,
	SL2:     1,
	SR1:     7,
	SR2:     1,
	MSK1:    0x9fffff5f9f7bffff,
	MSK2:    0xfffff7bb3efffffb,
	Parity1: 0xaf5390a3a8000001,
	Parity2: 0x6c11486db740b3f8,
}

Param4253 xxx

View Source
var Param44497 = &Parameter{
	MExp:    44497,
	Pos1:    330,
	SL1:     5,
	SL2:     3,
	SR1:     9,
	SR2:     3,
	MSK1:    0xdfbebfffeffffffb,
	MSK2:    0x9ffd7bffbfbf7bef,
	Parity1: 0x0000000000000001,
	Parity2: 0xecc1327aa3ac4000,
}

Param44497 xxx

View Source
var Param607 = &Parameter{
	MExp:    607,
	Pos1:    2,
	SL1:     15,
	SL2:     3,
	SR1:     13,
	SR2:     3,
	MSK1:    0xef7f3f7dfdff37ff,
	MSK2:    0x7ff7fb2fff777b7d,
	Parity1: 0x0000000000000001,
	Parity2: 0x5986f05400000000,
}

Param607 xxx

View Source
var Param86243 = &Parameter{
	MExp:    86243,
	Pos1:    366,
	SL1:     6,
	SL2:     7,
	SR1:     19,
	SR2:     1,
	MSK1:    0xbff7ff3ffdbffbff,
	MSK2:    0xbf9ff3fffd77efff,
	Parity1: 0x0000000000000001,
	Parity2: 0xe9528d8500000000,
}

Param86243 xxx

Functions

This section is empty.

Types

type Parameter

type Parameter struct {
	// Mersenne Exponent. The period of the sequence
	// is a multiple of 2^MEXP-1.
	MExp uint

	// the pick up position of the array.
	Pos1 uint

	// the parameter of shift left as four 32-bit registers.
	SL1 uint

	// the parameter of shift left as one 128-bit register.
	// The 128-bit integer is shifted by (SFMT_SL2 * 8) bits.
	SL2 uint

	// the parameter of shift right as four 32-bit registers.
	SR1 uint

	// the parameter of shift right as one 128-bit register.
	// The 128-bit integer is shifted by (SFMT_SR2 * 8) bits.
	SR2 uint

	// A bitmask, used in the recursion.
	// These parameters are introduced to break symmetry of SIMD.
	MSK1, MSK2 uint64

	// These definitions are part of a 128-bit period certification vector.
	Parity1, Parity2 uint64
}

Parameter is a parameter of Source.

func (*Parameter) String

func (p *Parameter) String() string

type Source

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

Source is a random source using Mersenne Twister algorithm.

func New

func New(param *Parameter) *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) Uint64

func (s *Source) Uint64() uint64

Uint64 implements math/rand.Source64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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