Documentation
¶
Index ¶
Examples ¶
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 splitmix64 algorithm.
Guy L. Steele, Doug Lea, and Christine H. Flood. 2014. Fast splittable pseudorandom number generators. SIGPLAN Not. 49, 10 (October 2014), 453–472. DOI:https://doi.org/10.1145/2714064.2660195
http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html http://prng.di.unimi.it/splitmix64.c
Example ¶
package main
import (
"fmt"
"math/rand"
"github.com/shogo82148/randsrc/splitmix64"
)
func main() {
src := splitmix64.New(1)
r := rand.New(src)
for i := 0; i < 10; i++ {
fmt.Println(r.Int63())
}
}
Output: 5225608189600411232 6878622605533214259 8955919645141445295 4098490376910890117 4097618618563484380 7036458801432265024 8092113344071933522 4824443200034030266 2633352815946178260 7323326090023318475
Click to show internal directories.
Click to hide internal directories.