unpack.sprng {rsprng}R Documentation

Restore the PRNG state.

Description

unpack.sprng unpacks a saved PRNG state and replace the current active PRNG state with the new one.

Usage

unpack.sprng (rngstate)

Arguments

rngstate an integer vector representing PRNG state (should be returned by either pack.sprng, spawn.sprng, spawn.new.sprng)

Value

Return the states of the old PRNG stream if there is one and return NULL if not.

Author(s)

Na (Michael) Li lina@u.washington.edu

References

SPRNG: Scalable Parallel Random Number Generator Library Web Page. http://sprng.cs.fsu.edu/

See Also

pack.sprng, spawn.sprng, spawn.new.sprng

Examples

init.sprng (1, 0, seed = 1132, kind = "LCG64")
runif (5)
rng.saved <- pack.sprng ()
runif (5)
unpack.sprng (rng.saved)
runif (5)
free.sprng ()

[Package rsprng version 0.3-3 Index]