rstream.RNG: Get and set "rstream" object from/to R global generator

rstream.RNGR Documentation

Get and set "rstream" object from/to R global generator

Description

The function rstream.RNG(stream) is used to set a given "rstream" object stream as current global R uniform random number generators.

Without an argument (or NULL) it returns an "rstream" object that contains the current global generator. It is a copy (clone) of the global generator and thus it can be handled independently from the global generator.

Usage

rstream.RNG(stream = NULL)

Arguments

stream

NULL or an "rstream" object

Value

rstream.RNG returns an "rstream" object.

Author(s)

Josef Leydold josef.leydold@wu.ac.at

See Also

rstream.

Examples

## create a new rstream.runif object
s <- new("rstream.mrg32k3a")

## use this stream as global R uniform RNG
rstream.RNG(s)

## get a (idenpendent) copy of the stream
## that contains the global R uniform RNG
gs <- rstream.RNG()

## change the state of the global generator
gs <- rstream.RNG()
rstream.nextsubstream(gs)
rstream.RNG(gs)


rstream documentation built on Oct. 19, 2022, 5:30 p.m.