rand

package
v0.0.0-...-b5d641a Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDim = uint32(6)
	MaxBit = uint32(30)
)
View Source
const (
	DefaultBufSize = 1 << 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

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

func New

func New(gt GeneratorType, seed uint64) *Generator

func NewTimeSeed

func NewTimeSeed(gt GeneratorType) *Generator

func (*Generator) Uniform

func (gen *Generator) Uniform(low, high float64) float64

func (*Generator) UniformAt

func (gen *Generator) UniformAt(low, high float64, target []float64)

func (*Generator) UniformInt

func (gen *Generator) UniformInt(low, high int) int

type GeneratorType

type GeneratorType uint8
const (
	Xorshift GeneratorType = iota
	Golang
	Tausworthe

	Default = Tausworthe
)

type SobolSequence

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

func NewSobolSequence

func NewSobolSequence() *SobolSequence

See Press et al. 2007.

func (*SobolSequence) Init

func (seq *SobolSequence) Init()

See Press et al. 2007.

func (*SobolSequence) Next

func (seq *SobolSequence) Next(dim int) []float64

See Press et al. 2007.

func (*SobolSequence) NextAt

func (seq *SobolSequence) NextAt(target []float64)

NextAt is equivelent to Next, except the Sobol sequence is returned in-place.

Jump to

Keyboard shortcuts

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