Jampack
Class Rand
- java.lang.Object
-
- Jampack.Rand
-
public class Rand extends java.lang.ObjectThe rand suite generates random objects with elements distributed randomly on [0,1] or normally with mean zero and standard deviation one.
-
-
Constructor Summary
Constructors Constructor and Description Rand()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublend()Generates a normal random double.static double[]ndary(int n)Generates a one-dimensional array of normal random doubles.static double[][]ndary(int m, int n)Generates a two-dimensional array of normal random doubles.static Znz()Generates a normal random complex number, i.e., a complex number whose real and imaginary parts are random.static Z1nz1(int n)Generates a normal random Z1.static Zmatnzmat(int m, int n)Generates a normal random Zmat.static voidsetSeed(long seed)Sets the seed for the random number generator.static doubleud()Generates a random uniform double.static double[]udary(int n)Generates a one-dimensional array of uniform random doubles.static double[][]udary(int m, int n)Generates a two-dimensional array of uniform random doubles.static Zuz()Generates a uniform random complex number, i.e., a complex number whose real and imaginary parts are random.static Z1uz1(int n)Generates a uniform random Z1.static Zmatuzmat(int m, int n)Generates a uniform random Zmat.
-
-
-
Method Detail
-
setSeed
public static void setSeed(long seed)
Sets the seed for the random number generator.- Parameters:
seed- The seed
-
ud
public static double ud()
Generates a random uniform double.- Returns:
- a uniform random double
-
udary
public static double[] udary(int n)
Generates a one-dimensional array of uniform random doubles.- Parameters:
n- The length of the array.- Returns:
- The array of uniform doubles.
-
udary
public static double[][] udary(int m, int n)Generates a two-dimensional array of uniform random doubles.- Parameters:
m- The number of rows in the array.n- The number of columns in the array.- Returns:
- The array of uniform doubles.
-
uz
public static Z uz()
Generates a uniform random complex number, i.e., a complex number whose real and imaginary parts are random.- Returns:
- The uniform random Z
-
uz1
public static Z1 uz1(int n) throws JampackException
Generates a uniform random Z1.- Parameters:
n- The length of the Z1- Returns:
- The uniform random Z1
- Throws:
JampackException- Passed from below.
-
uzmat
public static Zmat uzmat(int m, int n) throws JampackException
Generates a uniform random Zmat.- Parameters:
m- The number of rows in the Zmatn- The number of columns in the Zmat- Returns:
- The uniform random Zmat
- Throws:
JampackException- Passed from below.
-
nd
public static double nd()
Generates a normal random double.- Returns:
- a normal random double
-
ndary
public static double[] ndary(int n)
Generates a one-dimensional array of normal random doubles.- Parameters:
n- The length of the array.- Returns:
- The array of normal doubles.
-
ndary
public static double[][] ndary(int m, int n)Generates a two-dimensional array of normal random doubles.- Parameters:
m- The number of rows in the array.n- The number of columns in the array.- Returns:
- The array of normal doubles.
-
nz
public static Z nz()
Generates a normal random complex number, i.e., a complex number whose real and imaginary parts are random.- Returns:
- The normal random Z
-
nz1
public static Z1 nz1(int n) throws JampackException
Generates a normal random Z1.- Parameters:
n- The length of the Z1- Returns:
- The normal random Z1
- Throws:
JampackException- Passed from below.
-
nzmat
public static Zmat nzmat(int m, int n) throws JampackException
Generates a normal random Zmat.- Parameters:
m- The number of rows in the Zmatn- The number of columns in the Zmat- Returns:
- The normal random Zmat
- Throws:
JampackException- Passed from below.
-
-
DMelt 3.0 © DataMelt by jWork.ORG