Class Create
java.lang.Object
jcuda.utils.Create
Utility class for creating arrays containing random data.
By default, the methods of this class will always return
the same random data for the same sequence of calls, but
by invoking the
randomize()
method, the
results may be turned to be 'really' random.-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
createRandomDoubleData
(int size) Creates a new array with the given size, containing random datastatic float[]
createRandomFloatData
(int size) Creates a new array with the given size, containing random datastatic int[]
createRandomIntData
(int size) Creates a new array with the given size, containing random datastatic void
Will randomize the random number generatorstatic void
randomize
(long seed) Will initialize the random number generator with the given seed.
-
Method Details
-
randomize
public static void randomize()Will randomize the random number generator -
randomize
public static void randomize(long seed) Will initialize the random number generator with the given seed.- Parameters:
seed
- The random seed
-
createRandomFloatData
public static float[] createRandomFloatData(int size) Creates a new array with the given size, containing random data- Parameters:
size
- The size of the array- Returns:
- The array
-
createRandomDoubleData
public static double[] createRandomDoubleData(int size) Creates a new array with the given size, containing random data- Parameters:
size
- The size of the array- Returns:
- The array
-
createRandomIntData
public static int[] createRandomIntData(int size) Creates a new array with the given size, containing random data- Parameters:
size
- The size of the array- Returns:
- The array
-