message("Testing bpvectorize")
test_bpvectorize_Params <- function()
{
cl <- parallel::makeCluster(2)
doParallel::registerDoParallel(cl)
params <- list(
serial=SerialParam(),
snow=SnowParam(2),
dopar=DoparParam()
)
if (.Platform$OS.type != "windows")
params$mc <- MulticoreParam(2)
x <- 1:10
expected <- sqrt(x)
for (param in names(params)) {
psqrt <- bpvectorize(sqrt, BPPARAM=params[[param]])
checkIdentical(expected, psqrt(x))
}
## clean up
foreach::registerDoSEQ()
parallel::stopCluster(cl)
closeAllConnections()
TRUE
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.