ichi.maths.Rng

Marsaglia32x3

class Marsaglia32x3 extends RngIntState

George Marsaglia XorShift RNG with 32 bits of state and 3 shifts. From http://www.jstatsoft.org/v08/i14/paper. Very fast and reasonably random for 32 bits of state, but intrinsically cannot generate 0.

Linear Supertypes
RngIntState, Rng, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Marsaglia32x3
  2. RngIntState
  3. Rng
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Marsaglia32x3()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def doubles: Iterator[Double]

    Produce an endless stream of Doubles via an iterator

    Produce an endless stream of Doubles via an iterator

    Definition Classes
    Rng
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def floats: Iterator[Float]

    Produce an endless stream of Floats via an iterator

    Produce an endless stream of Floats via an iterator

    Definition Classes
    Rng
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. def ints: Iterator[Int]

    Produce an endless stream of Ints via an iterator

    Produce an endless stream of Ints via an iterator

    Definition Classes
    Rng
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def longs: Iterator[Long]

    Produce an endless stream of Longs via an iterator

    Produce an endless stream of Longs via an iterator

    Definition Classes
    Rng
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def nextDouble: Double

    Return the next Double in the stream.

    Return the next Double in the stream. Uses two ints to generate 53 random bits. Symmetric, but due to missing zero a small number of values are ~3% underrepresented.

    Definition Classes
    Marsaglia32x3Rng
  20. def nextFloat: Float

    Return the next Float in the range [0,1) from this random number stream.

    Return the next Float in the range [0,1) from this random number stream. Values are equally spaced. Based on nextInt shifted down to 24 bits.

    Definition Classes
    Rng
  21. def nextInt: Int

    Return the next Int in the stream.

    Return the next Int in the stream. 0 cannot be generated, so 1 is subtracted to recover it. (Thus, -1 cannot be generated.)

    Definition Classes
    Marsaglia32x3Rng
  22. def nextLong: Long

    Return the next Long in the stream.

    Return the next Long in the stream. Better to use Marsaglia64x3 if you need Longs--this requires three Ints to avoid weird glitches due to lack-of-zero.

    Definition Classes
    Marsaglia32x3RngIntStateRng
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def resetToDefault: Marsaglia32x3.this.type

    Sets this random number generator to its default initial state.

    Sets this random number generator to its default initial state.

    Definition Classes
    Marsaglia32x3Rng
  26. def roll(n: Int): Int

    Produce a number in {0, 1, .

    Produce a number in {0, 1, ..., n-1}

    Definition Classes
    Rng
  27. def rolls(n: Int): Iterator[Int]

    Produce an endless stream of numbers each drawn from {0, 1, .

    Produce an endless stream of numbers each drawn from {0, 1, ..., n-1} via an iterator

    Definition Classes
    Rng
  28. def seed(a: Array[Byte]): Marsaglia32x3.this.type

    Load stored state into the generator.

    Load stored state into the generator. The convention is that extra bytes are ignored, and a best-effort attempt is made to use overly short arrays to perform partial initialization.

    Definition Classes
    RngIntStateRng
  29. def seedI(i: Int): Marsaglia32x3.this.type

    Set the state to i.

    Set the state to i. Zero is a degenerate value, so it is promoted to 1.

    Definition Classes
    Marsaglia32x3RngIntState
  30. def seedWithTime: Marsaglia32x3.this.type

    Seed the generator with the current time.

    Seed the generator with the current time. Sequential calls from the same thread produce different seeds.

    Definition Classes
    Rng
  31. def state: Array[Byte]

    Store the current state of the generator in an array of bytes.

    Store the current state of the generator in an array of bytes.

    Definition Classes
    RngIntStateRng
  32. def stateI: Int

    The current state packed in an Int

    The current state packed in an Int

    Definition Classes
    Marsaglia32x3RngIntState
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  34. def toString(): String

    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  36. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  37. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from RngIntState

Inherited from Rng

Inherited from AnyRef

Inherited from Any

Ungrouped