示例#1
0
// UniformPos function returns a positive double precision floating point
// number uniformly distributed in the range (0,1), excluding both 0.0 and
// 1.0. The number is obtained by sampling the generator with the algorithm
// of Uniform until a non-zero value is obtained. You can use this function
// if you need to avoid a singularity at 0.0.
func (s *RngState) UniformPos() float64 {
	return float64(C.gsl_rng_uniform_pos(s.state))
}
示例#2
0
func UniformRandomPos(rng *RNG) float64 {
	return float64(C.gsl_rng_uniform_pos(rng.g))
}
示例#3
0
文件: rng.go 项目: postfix/gsl-1
func UniformPos(r *GslRng) float64 {
	return float64(C.gsl_rng_uniform_pos((*C.gsl_rng)(unsafe.Pointer(r.Ptr()))))
}
示例#4
0
文件: random.go 项目: npadmana/gslgo
// UniformPos returns a uniform random number between (0,1)
func (r *RNG) UniformPos() float64 {
	return float64(C.gsl_rng_uniform_pos(r.rng))
}