package Jampack;
import java.util.Random;
/**
The rand suite generates random objects with elements
distributed randomly on [0,1] or normally with mean zero
and standard deviation one.
@version Pre-alpha
@author G. W. Stewart
*/
public class Rand{
private static Random R = new Random();
/**
Sets the seed for the random number generator.
@param seed The seed
*/
public static void setSeed(long seed){
R.setSeed(seed);
}
/**
Generates a random uniform double.
@return a uniform random double
*/
public static double ud(){
return R.nextDouble();
}
/**
Generates a one-dimensional array of
uniform random doubles.
@param n The length of the array.
@return The array of uniform doubles.
*/
public static double[] udary(int n){
double d[] = new double[n];
for (int i=0; i
Ads help maintain this website.