spec.benchmarks.scimark.utils
Class Random

java.lang.Object
  extended by spec.benchmarks.scimark.utils.Random

public class Random
extends java.lang.Object


Constructor Summary
Random()
          Initializes a sequence of uniformly distributed quasi random numbers with a seed based on the system clock.
Random(double left, double right)
          Initializes a sequence of uniformly distributed quasi random numbers on a given half-open interval [left,right) with a seed based on the system clock.
Random(int seed)
          Initializes a sequence of uniformly distributed quasi random numbers with a given seed.
Random(int seed, double left, double right)
          Initializes a sequence of uniformly distributed quasi random numbers with a given seed on a given half-open interval [left,right).
 
Method Summary
 double nextDouble()
          Returns the next random number in the sequence.
 void nextDoubles(double[] x)
          Returns the next N random numbers in the sequence, as a vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random

public Random()
Initializes a sequence of uniformly distributed quasi random numbers with a seed based on the system clock.


Random

public Random(double left,
              double right)
Initializes a sequence of uniformly distributed quasi random numbers on a given half-open interval [left,right) with a seed based on the system clock.

Parameters:
left - The left endpoint of the half-open interval [left,right).
right - The right endpoint of the half-open interval [left,right).

Random

public Random(int seed)
Initializes a sequence of uniformly distributed quasi random numbers with a given seed.

Parameters:
seed - The seed of the random number generator. Two sequences with the same seed will be identical.

Random

public Random(int seed,
              double left,
              double right)
Initializes a sequence of uniformly distributed quasi random numbers with a given seed on a given half-open interval [left,right).

Parameters:
seed - The seed of the random number generator. Two sequences with the same seed will be identical.
left - The left endpoint of the half-open interval [left,right).
right - The right endpoint of the half-open interval [left,right).
Method Detail

nextDouble

public final double nextDouble()
Returns the next random number in the sequence.


nextDoubles

public final void nextDoubles(double[] x)
Returns the next N random numbers in the sequence, as a vector.