Documentation ¶
Index ¶
- func FairFlip[T any](rng IntnGenerator, tVal, fVal T) T
- func Flip(rng IntnGenerator, tWeight, fWeight int) bool
- type Gen
- type Int63Generator
- type IntnGenerator
- type NumGen32
- func (r *NumGen32) GetState() []byte
- func (r *NumGen32) Intn(n int) int
- func (r *NumGen32) RestoreState(state []byte)
- func (r *NumGen32) Roll(range_ Range[uint32]) uint32
- func (r *NumGen32) Rolls(ranges ...Range[uint32]) []uint32
- func (r *NumGen32) Seed(seed uint32)
- func (r *NumGen32) SeedFrom(seed uint32, index uint64)
- func (r *NumGen32) Uint32() uint32
- type Range
- type Source32
- type Uint32Generator
- type Uint64Generator
- type WordGen
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FairFlip ¶
func FairFlip[T any](rng IntnGenerator, tVal, fVal T) T
func Flip ¶
func Flip(rng IntnGenerator, tWeight, fWeight int) bool
Types ¶
type Gen ¶
type Gen[T any] func(p IntnGenerator) T
type Int63Generator ¶
type Int63Generator interface {
Int63() int64
}
type IntnGenerator ¶
type NumGen32 ¶
func NewNumGen32 ¶
func NewNumGen32FromIndex ¶
func (*NumGen32) RestoreState ¶
type Range ¶
func NewZeroRange ¶
func (Range[TNum]) Roll ¶
func (r Range[TNum]) Roll(rng IntnGenerator) TNum
type Uint32Generator ¶
type Uint32Generator interface {
Uint32() uint32
}
type Uint64Generator ¶
type Uint64Generator interface {
Uint64() uint64
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.