Module xorshift

Types

Xorshift128Plus = Xorshift128PlusState
xorshift128+. Based on http://xorshift.di.unimi.it/
  • Period: 2^128 - 1
  • State: 16 bytes
  Source
Xorshift1024Star = Xorshift1024StarState
xorshift1024*. Based on http://xorshift.di.unimi.it/
  • Period: 2^1024 - 1
  • State: 128 bytes + int
  Source

Procs

proc randomUint64(self: var Xorshift128Plus): uint64 {.inline, raises: [], 
    tags: [].}
  Source
proc initXorshift128Plus(seed: array[2, uint64]): Xorshift128Plus {.
    raises: [ValueError], tags: [].}

Seeds a new Xorshift128Plus with 2 uint64.

Raises ValueError if the seed consists of only zeros.

  Source
proc initXorshift128Plus(seed: array[16, uint8]): Xorshift128Plus {.
    raises: [ValueError], tags: [].}

Seeds a new Xorshift128Plus with an array of 16 bytes.

Raises ValueError if the seed consists of only zeros.

  Source
proc initXorshift128Plus(seed: uint64): Xorshift128Plus {.raises: [ValueError], 
    tags: [].}

Seeds a new Xorshift128Plus with an uint64.

Raises ValueError if the seed consists of only zeros.

  Source
proc randomUint64(self: var Xorshift1024Star): uint64 {.inline, raises: [], 
    tags: [].}
  Source
proc initXorshift1024Star(seed: array[16, uint64]): Xorshift1024Star {.
    raises: [ValueError], tags: [].}

Seeds a new Xorshift1024Star with 16 uint64.

Raises ValueError if the seed consists of only zeros.

  Source
proc initXorshift1024Star(seed: array[128, uint8]): Xorshift1024Star {.
    raises: [ValueError], tags: [].}

Seeds a new Xorshift1024Star with an array of 128 bytes.

Raises ValueError if the seed consists of only zeros.

  Source
proc initXorshift1024Star(seed: uint64): Xorshift1024Star {.
    raises: [ValueError], tags: [].}

Seeds a new Xorshift1024Star using an uint64.

Raises ValueError if the seed consists of only zeros.

  Source