Exemple #1
0
// MTfloat64s generates pseudo random real numbers between low and high; i.e. in [low, right)
// using the Mersenne Twister method.
//  Input:
//   low  -- lower limit (closed)
//   high -- upper limit (open)
//  Output:
//   values -- slice to be filled with len(values) numbers
func MTfloat64s(values []float64, low, high float64) {
	for i := 0; i < len(values); i++ {
		values[i] = dsfmt.Rand(low, high)
	}
}
Exemple #2
0
// MTfloat64 generates pseudo random real numbers between low and high; i.e. in [low, right)
// using the Mersenne Twister method.
//  Input:
//   low  -- lower limit (closed)
//   high -- upper limit (open)
//  Output:
//   random float64
func MTfloat64(low, high float64) float64 {
	return dsfmt.Rand(low, high)
}