Packages

class XORShiftRandom extends Random

XORShiftRandom

copy from spark framework

This class implements a XORShift random number generator algorithm Source: Marsaglia, G. (2003). Xorshift RNGs. Journal of Statistical Software, Vol. 8, Issue 14. http://www.jstatsoft.org/v08/i14/paper This implementation is approximately 3.5 times faster than java.util.Random, partly because of the algorithm, but also due to renouncing thread safety. JDK's implementation uses an AtomicLong seed, this class uses a regular Long. We can forgo thread safety since we use a new instance of the RNG for each thread.

Version

1.0 23/01/2018 20:08

Linear Supertypes
Random, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. XORShiftRandom
  2. Random
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new XORShiftRandom()
  2. new XORShiftRandom(init: Long)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def doubles(arg0: Double, arg1: Double): DoubleStream
    Definition Classes
    Random
  7. def doubles(arg0: Long, arg1: Double, arg2: Double): DoubleStream
    Definition Classes
    Random
  8. def doubles(): DoubleStream
    Definition Classes
    Random
  9. def doubles(arg0: Long): DoubleStream
    Definition Classes
    Random
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. def ints(arg0: Int, arg1: Int): IntStream
    Definition Classes
    Random
  15. def ints(arg0: Long, arg1: Int, arg2: Int): IntStream
    Definition Classes
    Random
  16. def ints(): IntStream
    Definition Classes
    Random
  17. def ints(arg0: Long): IntStream
    Definition Classes
    Random
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def longs(arg0: Long, arg1: Long): LongStream
    Definition Classes
    Random
  20. def longs(arg0: Long, arg1: Long, arg2: Long): LongStream
    Definition Classes
    Random
  21. def longs(): LongStream
    Definition Classes
    Random
  22. def longs(arg0: Long): LongStream
    Definition Classes
    Random
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def next(bits: Int): Int
    Attributes
    protected
    Definition Classes
    XORShiftRandom → Random
  25. def nextBoolean(): Boolean
    Definition Classes
    Random
  26. def nextBytes(arg0: Array[Byte]): Unit
    Definition Classes
    Random
  27. def nextDouble(): Double
    Definition Classes
    Random
  28. def nextFloat(): Float
    Definition Classes
    Random
  29. def nextGaussian(): Double
    Definition Classes
    Random
  30. def nextInt(arg0: Int): Int
    Definition Classes
    Random
  31. def nextInt(): Int
    Definition Classes
    Random
  32. def nextLong(): Long
    Definition Classes
    Random
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. def setSeed(s: Long): Unit
    Definition Classes
    XORShiftRandom → Random
  36. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Random

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped