R Under development (unstable) (2024-10-17 r87242 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(randtoolbox) Loading required package: rngWELL This is randtoolbox. For an overview, type 'help("randtoolbox")'. > > params <- c( + "512a", + "521a", + "521b", + "607a", + "607b", + "800a", + "800b", + "1024a", + "1024b", + "19937a", + "19937b", + "19937c", + "21701a", + "23209a", + "23209b", + "44497a", + "44497b") > > result1 <- rep(NA, times=length(params)) > result2 <- rep(NA, times=length(params)) > > seed <- floor(2^31*runif(1)) > cat("using seed", seed, "for test of the output of WELL RNG\n") using seed 894799445 for test of the output of WELL RNG > > m <- 100 > cat("generating sequences of the length", m, "from each generator\n") generating sequences of the length 100 from each generator > > for (i in 1:length(params)) + { + cat(i, "") + set.generator("WELL", version=params[i], seed=seed) + s0 <- getWELLState() + x <- runif(m) + out <- rngWELLScriptR(m, s0, params[i], includeState=TRUE) + s1 <- getWELLState() + result1[i] <- all(x == out$x) + result2[i] <- all(s1 == out$state) + } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 > > cat("\n\n") > print(data.frame(params, result1, result2)) params result1 result2 1 512a TRUE TRUE 2 521a TRUE TRUE 3 521b TRUE TRUE 4 607a TRUE TRUE 5 607b TRUE TRUE 6 800a TRUE TRUE 7 800b TRUE TRUE 8 1024a TRUE TRUE 9 1024b TRUE TRUE 10 19937a TRUE TRUE 11 19937b TRUE TRUE 12 19937c TRUE TRUE 13 21701a TRUE TRUE 14 23209a TRUE TRUE 15 23209b TRUE TRUE 16 44497a TRUE TRUE 17 44497b TRUE TRUE > > stopifnot(all(result1, result2)) > > > proc.time() user system elapsed 0.60 0.32 0.92