sitmo_parallel: Test Generation using sitmo and C++11

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

Description

The function provides an implementation of creating realizations from the default engine.

Usage

1
sitmo_parallel(n, seeds)

Arguments

n

An unsigned integer denoting the number of realizations to generate.

seeds

A vec containing a list of seeds. Each seed is run on its own core.

Details

The following function's true power is only accessible on platforms that support OpenMP (e.g. Windows and Linux). However, it does provide a very good example as to how to make ones code applicable across multiple platforms.

With this being said, how we determine how many cores to split the generation to is governed by the number of seeds supplied. In the event that one is using OS X, only the first seed supplied is used.

Value

A vec containing the realizations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
a = sitmo_parallel(10, c(1))

b = sitmo_parallel(10, c(1,2))

c = sitmo_parallel(10, c(1,2))

# True on only OS X or systems without openmp
isTRUE(all.equal(a,b))

isTRUE(all.equal(b,c))

sitmo documentation built on Oct. 13, 2021, 9:07 a.m.