// UniformInt returns a random integer from 0 to n − 1 inclusive by scaling // down and/or discarding samples from the generator r. All integers in the // range [0, n − 1] are produced with equal probability. For generators with // a non-zero minimum value an offset is applied so that zero is returned // with the correct probability. Note that this function is designed for // sampling from ranges smaller than the range of the underlying generator. // The parameter n must be less than or equal to the range of the generator r. // If n is larger than the range of the generator then the function // calls the error handler with an error code of GSL_EINVAL and returns zero. // In particular, this function is not intended for generating the full range // of unsigned integer values [0, 2 32 − 1]. Instead choose a generator with // the maximal integer range and zero minimum value, such as gsl_rng_ranlxd1, // gsl_rng_mt19937 or gsl_rng_taus, and sample it directly using gsl_rng_get. // The range of each can be found with the help of auxiliary sections. func (s *RngState) UniformInt(limit uint64) uint64 { return uint64(C.gsl_rng_uniform_int(s.state, C.ulong(limit))) }
func UniformRandomInt(rng *RNG, n int) int { return int(C.gsl_rng_uniform_int(rng.g, C.ulong(n))) }
func UniformInt(r *GslRng, n int) int { return int(C.gsl_rng_uniform_int((*C.gsl_rng)(unsafe.Pointer(r.Ptr())), C.ulong(n))) }
// UniformInt returns a uniform random number between (0,1) func (r *RNG) UniformInt(max int64) int64 { return int64(C.gsl_rng_uniform_int(r.rng, C.ulong(max))) }