EVOLUTION-MANAGER
Edit File: CurrentStream.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Set/unset the current stream</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for CurrentStream {rlecuyer}"><tr><td>CurrentStream {rlecuyer}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Set/unset the current stream</h2> <h3>Description</h3> <p><code>.lec.CurrentStream</code> sets the current stream for usage with the standard R functions for generating random numbers such as <code><a href="../../stats/html/Uniform.html">runif</a></code> or <code><a href="../../stats/html/Normal.html">rnorm</a></code>. <code>.lec.CurrentStreamEnd unsets it.</code></p> <h3>Usage</h3> <pre> .lec.CurrentStream (name) .lec.CurrentStreamEnd (kind.old = c("Marsaglia-Multicarry", "Kinderman-Ramage")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>a character string giving the name of the stream.</p> </td></tr> <tr valign="top"><td><code>kind.old</code></td> <td> <p>a length 2 character vector, the old rng kinds (possiblly returned by <code>.lec.CurrentStream</code>).</p> </td></tr> </table> <h3>Details</h3> <p><code>.lec.CurrentStream</code> sets the RNGkind to user-defined. All succeeding calls of R built-in genertors will generate random numbers from the stream <code>name</code>, until <code>.lec.CurrentStreamEnd</code> is called. <code>.lec.CurrentStreamEnd</code> updates the RNG state of the stream <code>name</code> in the table <code>.lec.Random.seed.table</code> and sets the RNGkind to <code>kind.old</code>. These two functions are meant to be always used as a pair. Thus, one can arbitrarily switch generating between different streams. </p> <h3>Value</h3> <p><code>.lec.CurrentStream</code> returns a two-element character vector of the RNG and normal kinds in use before the call. <code>.lec.CurrentStreamEnd</code> returns a character string giving the name of the unset current stream. </p> <h3>Examples</h3> <pre> nstreams <- 10 # number of streams names <- paste("mystream",1:nstreams,sep="") .lec.CreateStream(names) for (i in 1:nstreams) { # generate 10 RNs from each stream .lec.CurrentStream(names[i]) print(paste("stream no.",i)) print(runif(10)) .lec.CurrentStreamEnd() } </pre> <hr /><div style="text-align: center;">[Package <em>rlecuyer</em> version 0.3-4 <a href="00Index.html">Index</a>]</div> </body></html>