R/utils_parallel.R

Defines functions .setup_pcg_state

#' @importFrom dqrng generateSeedVectors
.setup_pcg_state <- function(per.core) {
    seeds <- streams <- vector("list", length(per.core))
    last <- 0L
    for (i in seq_along(per.core)) { 
        N <- per.core[i]
        seeds[[i]] <- generateSeedVectors(N, nwords=2)
        streams[[i]] <- last + seq_len(N)
        last <- last + N
    }
    list(seeds=seeds, streams=streams)
}

Try the scran package in your browser

Any scripts or data that you put into this service are public.

scran documentation built on April 17, 2021, 6:09 p.m.