Skip to content

Commit

Permalink
export function
Browse files Browse the repository at this point in the history
  • Loading branch information
philchalmers committed Aug 16, 2024
1 parent 89ca67d commit 4a24223
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export(aggregate_simulations)
export(bias)
export(bootPredict)
export(boot_predict)
export(clusterSetRNGSubStream)
export(colSDs)
export(colVars)
export(createDesign)
Expand Down
16 changes: 16 additions & 0 deletions R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,22 @@ set_seed <- function(seed){

recvResult_fun <- utils::getFromNamespace("recvResult", "snow")

#' Set RNG sub-stream for Pierre L'Ecuyer's RngStreams
#'
#' Sets the sub-stream RNG state within for Pierre L'Ecuyer's (1999)
#' algorithm. Should be used within distributed array jobs
#' after suitable L'Ecuyer's (1999) have been distributed to each array, and
#' each array is further defined to use multi-core processing. See
#' \code{\link[parallel]{clusterSetRNGStream}} for further information.
#'
#' @param seed An integer vector of length 7 as given by \code{.Random.seed} when
#' the L'Ecuyer-CMR RNG is in use. See\code{\link{RNG}} for the valid values
#' @param cl A cluster from the \code{parallel} or \code{snow} package, or
#' (if \code{NULL}) the registered cluster
#' @return invisible NULL
#' @export
#'
#'
clusterSetRNGSubStream <- function(cl, seed){
nc <- length(cl)
seeds <- vector("list", nc)
Expand Down
25 changes: 25 additions & 0 deletions man/clusterSetRNGSubStream.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4a24223

Please sign in to comment.