View source: R/rngWELLScriptR.R
rngWELLScriptR | R Documentation |
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.
rngWELLScriptR(n, s, generator, includeState=FALSE)
n |
Integer. The length of the output sequence. |
s |
An 0,1-matrix representing the state of the required WELL generator
as obtained by |
generator |
Character string. Name of the generator from the list
|
includeState |
Logical. Controls, whether the output should contain the final internal state additionally to the numerical output or not. |
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).
getWELLState
set.generator("WELL", order=512, version="a", seed=123456)
s <- getWELLState()
x <- runif(500)
y <- rngWELLScriptR(500, s, "512a")
all(x == y)
# [1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.