Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rngWELLScriptR

An implementation of the recurrence of WELL generators in R language


Description

An implementation of the recurrence of WELL generators in R language for testing purposes. It is too slow to be used for random number generation.

Usage

rngWELLScriptR(n, s, generator, includeState=FALSE)

Arguments

n

Integer. The length of the output sequence.

s

An 0,1-matrix representing the state of the required WELL generator as obtained by getWELLState().

generator

Character string. Name of the generator from the list "512a", "521a", "521b", "607a", "607b", "800a", "800b", "1024a", "1024b", "19937a", "19937c", "19937b", "21701a", "23209a", "23209b", "44497a", "44497b".

includeState

Logical. Controls, whether the output should contain the final internal state additionally to the numerical output or not.

Value

If includeState=FALSE, a numeric vector of length n containing the numerical output of the generator. If includeState=TRUE, a list with components x (the numerical output) and state (the final internal state of the generator).

See Also

Examples

set.generator("WELL", order=512, version="a", seed=123456)
  s <- getWELLState()
  x <- runif(500)
  y <- rngWELLScriptR(500, s, "512a")
  all(x == y)
  # [1] TRUE

randtoolbox

Toolbox for Pseudo and Quasi Random Number Generation and Random Generator Tests

v1.30.1
BSD_3_clause + file LICENSE
Authors
R port by Yohan Chalabi, Christophe Dutang, Petr Savicky and Diethelm Wuertz with some underlying C codes of (i) the SFMT algorithm from M. Matsumoto and M. Saito, (ii) the Knuth-TAOCP RNG from D. Knuth.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.