Documentation ¶
Index ¶
- Constants
- func NewPcgXslRrSource(seed int64) rand.Source64
- func NewSmallPrngSource(seed int64) rand.Source64
- func NewSplitMix64Source(seed int64) rand.Source64
- func NewSquirrel3Prime64Source(seed int64) rand.Source64
- func NewSquirrel3Source(seed int64) rand.Source64
- func NewSquirrel3x2Source(seed int64) rand.Source64
- func NewSxmMixSource(seed int64) rand.Source64
- func NewSxmSource(seed int64) rand.Source64
- func NewXoshiro256ppSource(seed int64) rand.Source64
- func NewXoshiro256ssSource(seed int64) rand.Source64
- type PcgXslRrSource
- type PositionalSource
- type SmallPrngSource
- type SplitMix64Source
- type Squirrel3Prime64Source
- type Squirrel3Source
- type Squirrel3x2Source
- type SxmMixSource
- type SxmSource
- type Xoshiro256ppSource
- type Xoshiro256ssSource
Constants ¶
const ( BIT_NOISE_A uint64 = 0xa55d924b5499ede9 // 0b1010010101011101100100100100101101010100100110011110110111101001 BIT_NOISE_B uint64 = 0x531e8dd1c779c9d1 // 0b0101001100011110100011011101000111000111011110011100100111010001 BIT_NOISE_C uint64 = 0xf6e7845905e176cb // 0b1111011011100111100001000101100100000101111000010111011011001011 )
Variables ¶
This section is empty.
Functions ¶
func NewPcgXslRrSource ¶ added in v0.2.0
func NewSmallPrngSource ¶
func NewSplitMix64Source ¶ added in v0.1.1
func NewSquirrel3Prime64Source ¶ added in v0.3.0
func NewSquirrel3Source ¶ added in v0.3.0
func NewSquirrel3x2Source ¶ added in v0.3.0
func NewSxmMixSource ¶ added in v0.3.0
NewSxmMixSource returns a new SxmMixSource that uses the given seed value.
func NewSxmSource ¶ added in v0.3.0
NewSxmSource returns a new SxmSource that uses the given seed value.
func NewXoshiro256ppSource ¶ added in v0.1.1
func NewXoshiro256ssSource ¶ added in v0.1.1
Types ¶
type PcgXslRrSource ¶ added in v0.2.0
type PcgXslRrSource struct {
// contains filtered or unexported fields
}
func (*PcgXslRrSource) Int63 ¶ added in v0.2.0
func (s *PcgXslRrSource) Int63() int64
func (*PcgXslRrSource) Seed ¶ added in v0.2.0
func (s *PcgXslRrSource) Seed(seed int64)
func (*PcgXslRrSource) Uint64 ¶ added in v0.2.0
func (s *PcgXslRrSource) Uint64() uint64
type PositionalSource ¶ added in v0.3.0
type PositionalSource interface { rand.Source64 // Position return current position of random generator Position() int64 // SetPosition set position of random generator SetPosition(int64) }
PositionalSource allow to point generated random by its position
type SmallPrngSource ¶
type SmallPrngSource struct {
// contains filtered or unexported fields
}
func (*SmallPrngSource) Int63 ¶
func (s *SmallPrngSource) Int63() int64
func (*SmallPrngSource) Seed ¶
func (s *SmallPrngSource) Seed(seed int64)
func (*SmallPrngSource) Uint64 ¶
func (s *SmallPrngSource) Uint64() uint64
type SplitMix64Source ¶ added in v0.1.1
type SplitMix64Source struct {
// contains filtered or unexported fields
}
func (*SplitMix64Source) Int63 ¶ added in v0.1.1
func (s *SplitMix64Source) Int63() int64
func (*SplitMix64Source) Seed ¶ added in v0.1.1
func (s *SplitMix64Source) Seed(seed int64)
func (*SplitMix64Source) Uint64 ¶ added in v0.1.1
func (s *SplitMix64Source) Uint64() uint64
type Squirrel3Prime64Source ¶ added in v0.3.0
type Squirrel3Prime64Source struct {
Squirrel3Source
}
func (*Squirrel3Prime64Source) Int63 ¶ added in v0.3.0
func (s *Squirrel3Prime64Source) Int63() int64
func (*Squirrel3Prime64Source) Uint64 ¶ added in v0.3.0
func (s *Squirrel3Prime64Source) Uint64() uint64
type Squirrel3Source ¶ added in v0.3.0
type Squirrel3Source struct {
// contains filtered or unexported fields
}
func (*Squirrel3Source) Int63 ¶ added in v0.3.0
func (s *Squirrel3Source) Int63() int64
func (*Squirrel3Source) Position ¶ added in v0.3.0
func (s *Squirrel3Source) Position() int64
func (*Squirrel3Source) Seed ¶ added in v0.3.0
func (s *Squirrel3Source) Seed(seed int64)
func (*Squirrel3Source) SetPosition ¶ added in v0.3.0
func (s *Squirrel3Source) SetPosition(pos int64)
func (*Squirrel3Source) Uint64 ¶ added in v0.3.0
func (s *Squirrel3Source) Uint64() uint64
type Squirrel3x2Source ¶ added in v0.3.0
type Squirrel3x2Source struct {
Squirrel3Source
}
func (*Squirrel3x2Source) Int63 ¶ added in v0.3.0
func (s *Squirrel3x2Source) Int63() int64
func (*Squirrel3x2Source) Uint64 ¶ added in v0.3.0
func (s *Squirrel3x2Source) Uint64() uint64
type SxmMixSource ¶ added in v0.3.0
type SxmMixSource struct {
SxmSource
}
SxmMixSource is a random number generator based on SxmSource with mix64 (like in xxhash) bits permutation in the end
func (*SxmMixSource) Int63 ¶ added in v0.3.0
func (s *SxmMixSource) Int63() int64
Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
func (*SxmMixSource) Uint64 ¶ added in v0.3.0
func (s *SxmMixSource) Uint64() uint64
Uint64 returns a pseudo-random 64-bit value as a uint64.
type SxmSource ¶ added in v0.3.0
type SxmSource struct {
// contains filtered or unexported fields
}
SxmSource is a random number generator based on Squirrel3 with more bits permutation (inspired by xxhash) Sxm build from Sums and XORs and Multiplications steps (SXM) It's a 64-bit generator with position and seed support
func (*SxmSource) Int63 ¶ added in v0.3.0
Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
func (*SxmSource) SetPosition ¶ added in v0.3.0
SetPosition sets current position
type Xoshiro256ppSource ¶ added in v0.1.1
type Xoshiro256ppSource struct {
// contains filtered or unexported fields
}
func (*Xoshiro256ppSource) Int63 ¶ added in v0.1.1
func (x *Xoshiro256ppSource) Int63() int64
func (*Xoshiro256ppSource) Jump ¶ added in v0.1.1
func (x *Xoshiro256ppSource) Jump() rand.Source64
func (*Xoshiro256ppSource) LongJump ¶ added in v0.1.1
func (x *Xoshiro256ppSource) LongJump() rand.Source64
func (*Xoshiro256ppSource) Seed ¶ added in v0.1.1
func (x *Xoshiro256ppSource) Seed(seed int64)
func (*Xoshiro256ppSource) Uint64 ¶ added in v0.1.1
func (x *Xoshiro256ppSource) Uint64() uint64
type Xoshiro256ssSource ¶ added in v0.1.1
type Xoshiro256ssSource struct {
// contains filtered or unexported fields
}
func (*Xoshiro256ssSource) Int63 ¶ added in v0.1.1
func (x *Xoshiro256ssSource) Int63() int64
func (*Xoshiro256ssSource) Jump ¶ added in v0.1.1
func (x *Xoshiro256ssSource) Jump() rand.Source64
func (*Xoshiro256ssSource) LongJump ¶ added in v0.1.1
func (x *Xoshiro256ssSource) LongJump() rand.Source64
func (*Xoshiro256ssSource) Seed ¶ added in v0.1.1
func (x *Xoshiro256ssSource) Seed(seed int64)
func (*Xoshiro256ssSource) Uint64 ¶ added in v0.1.1
func (x *Xoshiro256ssSource) Uint64() uint64