示例#1
0
 public long getIthLong(long i) {
   final LocalRandom localRandom = r.get();
   localRandom.setSeed(seed * BIG_PRIME + i * SMALL_PRIME);
   return localRandom.nextLong();
 }
示例#2
0
  /**
   * Returns the i'th pseudorandom, uniformly distributed {@code double} value between {@code 0.0}
   * and {@code 1.0} from this random number generator's sequence.
   *
   * @param i
   * @return
   */
  public double getIthDouble(long i) {
    LocalRandom localRandom = r.get();

    localRandom.setSeed(seed * BIG_PRIME + i * SMALL_PRIME);
    return localRandom.nextDouble();
  }
示例#3
0
 public int getIthPositiveInteger(long i) {
   final LocalRandom localRandom = r.get();
   localRandom.setSeed(seed * BIG_PRIME + i * SMALL_PRIME);
   return Math.abs(localRandom.nextInt());
 }