jcuda.utils
Class Create

java.lang.Object
  extended by jcuda.utils.Create

public class Create
extends java.lang.Object

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
static double[] createRandomDoubleData(int size)
          Creates a new array with the given size, containing random data
static float[] createRandomFloatData(int size)
          Creates a new array with the given size, containing random data
static int[] createRandomIntData(int size)
          Creates a new array with the given size, containing random data
static void randomize()
          Will randomize the random number generator
static void randomize(long seed)
          Will initialize the random number generator with the given seed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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