com.carrotsearch.hppc
Class XorShiftRandom

java.lang.Object
  extended by java.util.Random
      extended by com.carrotsearch.hppc.XorShiftRandom
All Implemented Interfaces:
java.io.Serializable

public class XorShiftRandom
extends java.util.Random

XorShift pseudo random number generator. This class is not thread-safe and should be used from a single thread only.

See Also:
"http://en.wikipedia.org/wiki/Xorshift", "http://www.jstatsoft.org/v08/i14/paper", "http://www.javamex.com/tutorials/random_numbers/xorshift.shtml", Serialized Form

Constructor Summary
XorShiftRandom()
           
XorShiftRandom(long seed)
           
 
Method Summary
protected  int next(int bits)
           
 long nextLong()
           
 void setSeed(long seed)
           
 
Methods inherited from class java.util.Random
nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XorShiftRandom

public XorShiftRandom()

XorShiftRandom

public XorShiftRandom(long seed)
Method Detail

nextLong

public long nextLong()
Overrides:
nextLong in class java.util.Random

next

protected int next(int bits)
Overrides:
next in class java.util.Random

setSeed

public void setSeed(long seed)
Overrides:
setSeed in class java.util.Random


Copyright © 2011 Carrot Search s.c.. All Rights Reserved.