/
randomn.html
68 lines (57 loc) · 3.05 KB
/
randomn.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>SHTOOLS - Miscellaneous routines</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../css/sh.css">
<link rel="icon" type="image/vnd.microsoft.icon" href="../../images/favicon.ico">
</head>
<body>
<div class="main">
<p class="centeredimage"><img src="../../images/logo.jpg" width=894 height=135 alt="SHTOOLS --- Tools for working with spherical harmonics"></p>
<table class="menu">
<tbody>
<tr>
<td><a href="../../../index.html">HOME</a></td>
<td><a href="https://github.com/SHTOOLS/SHTOOLS/releases">DOWNLOAD</a></td>
<td class="selected"><a href="../../documentation.html">DOCUMENTATION</a></td>
<td><a href="../../faq.html">FAQ</a> </td>
</tr>
</tbody>
</table>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../other.html" class="dir">Other</a></p>
<h1 id="randomn">RandomN</h1>
<p>Return a pseudo uniform random deviate between 0 and 1 using the algorithm of Park and Miller with a Marsaglia shift sequence.</p>
<h1 id="usage">Usage</h1>
<p><code>rn</code> = RandomN (<code>seed</code>)</p>
<h1 id="parameters">Parameters</h1>
<dl>
<dt><code>rn</code> : output, real*8</dt>
<dd>The uniform random deviate.
</dd>
<dt><code>seed</code> : input/output, integer</dt>
<dd>Input a negative integer to (re-)initialize the random number generator. Afterwards, this argument should not be modified.
</dd>
</dl>
<h1 id="description">Description</h1>
<p><code>RandomN</code> will return a uniform random deviate between 0 and 1 (exclusive of the endpoints) using the algorithm of Park and Miller combined with a Marsaglia shift sequence. The random number generator is intialized by calling with a negative value of <code>seed</code>, and afterwards this variable should not be modified. The period of this generator is claimed to be about 3.1 10^18 (see Press et al. 2002).</p>
<h1 id="references">References</h1>
<p>Press, W.H., S.A. Teukolsky, W.T. Vetterling, and B.P. Flannery, Numerical Recipes in FORTRAN 90: Volume 2 of FORTRAN numerical recipes, 2nd ed., Cambridge Univ. Press, Cambridge, UK, 2002.</p>
<h1 id="see-also">See also</h1>
<p><a href="randomgaussian.html">randomgaussian</a></p>
<p class="dir">
> <a href="../../../index.html" class="dir">Home</a> > <a href="../../documentation.html" class="dir">Documentation</a> > <a href="../../f95-routines.html" class="dir">Fortran 95</a> > <a href="../../other.html" class="dir">Other</a></p>
<table class="footer2">
<tbody>
<tr>
<td class="c1"><a href="https://lagrange.oca.eu/?lang=en">Laboratoire Lagrange</a></td>
<td class="c2"><a href="https://www.oca.eu/?lang=en">Observatoire de la Côte d'Azur</a></td>
<td class="c3">© 2017 <a href="https://github.com/SHTOOLS">SHTOOLS</a></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>