Statistiques
| Révision :

root / www / HPL_rand.html

Historique | Voir | Annoter | Télécharger (1,32 ko)

1
<HTML>
2
<HEAD>
3
<TITLE>HPL_rand HPL 2.0 Library Functions September 10, 2008</TITLE> 
4
</HEAD>
5

    
6
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099"
7
      ALINK = "#ffff00">
8

    
9
<H1>Name</H1>
10
<B>HPL_rand</B> random number generator.
11

    
12
<H1>Synopsis</H1>
13
<CODE>#include "hpl.h"</CODE><BR><BR>
14
<CODE>double</CODE>
15
<CODE>HPL_rand();</CODE>
16

    
17
<H1>Description</H1>
18
<B>HPL_rand</B>
19
generates  the next number  in the  random  sequence.  This
20
function  ensures  that this number lies in the interval (-0.5, 0.5].
21
 
22
The static array irand contains the information (2 integers) required
23
to generate the  next number  in the sequence  X(n).  This  number is
24
computed as X(n) = (2^16 * irand[1] + irand[0]) / d - 0.5,  where the
25
constant d is the largest 32 bit positive integer. The array irand is
26
then  updated  for the generation of the next number  X(n+1)  in  the
27
random sequence as follows X(n+1) = a * X(n) + c. The constants a and
28
c  should have been preliminarily stored in the arrays ias and ics as
29
2 pairs of integers.  The initialization of  ias,  ics and  irand  is
30
performed by the function HPL_setran.
31

    
32
<H1>See Also</H1>
33
<A HREF="HPL_ladd.html">HPL_ladd</A>,
34
<A HREF="HPL_lmul.html">HPL_lmul</A>,
35
<A HREF="HPL_setran.html">HPL_setran</A>,
36
<A HREF="HPL_xjumpm.html">HPL_xjumpm</A>,
37
<A HREF="HPL_jumpit.html">HPL_jumpit</A>.
38

    
39
</BODY>
40
</HTML>