예제 #1
0
파일: random.go 프로젝트: haskelladdict/gsl
// Set initializes (or ‘seeds’) the random number generator. If the
// generator is seeded with the same value of seed on two different runs,
// the same stream of random numbers will be generated by successive calls
// to the routines below. If different values of seed ≥ 1 are supplied,
// then the generated streams of random numbers should be completely
// different. If the seed seed is zero then the standard seed from the
// original implementation is used instead. For example, the original
// Fortran source code for the ranlux generator used a seed of 314159265,
// and so choosing seed equal to zero reproduces this when using
// gsl_rng_ranlux.
//
// When using multiple seeds with the same generator, choose seed values
// greater than zero to avoid collisions with the default setting.
// Note that the most generators only accept 32-bit seeds, with higher
// values being reduced modulo 2^32 . For generators with smaller ranges
// the maximum seed value will typically be lower.
func (s *RngState) Set(seed uint64) {
	C.gsl_rng_set(s.state, C.ulong(seed))
}
예제 #2
0
func setSeed(r *C.gsl_rng, seed C.ulong) {
	C.gsl_rng_set(r, seed)
}
예제 #3
0
파일: rng.go 프로젝트: postfix/gsl-1
func Set(r *GslRng, s int) {
	C.gsl_rng_set((*C.gsl_rng)(unsafe.Pointer(r.Ptr())), C.ulong(s))
}
예제 #4
0
파일: random.go 프로젝트: npadmana/gslgo
// Seed seeds the random number generator
func (r *RNG) Seed(s int64) {
	C.gsl_rng_set(r.rng, C.ulong(s))
}