Statistiques
| Révision :

root / www / HPL_setran.html

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

1
<HTML>
2
<HEAD>
3
<TITLE>HPL_setran 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_setran</B> Manage the random number generator.
11

    
12
<H1>Synopsis</H1>
13
<CODE>#include "hpl.h"</CODE><BR><BR>
14
<CODE>void</CODE>
15
<CODE>HPL_setran(</CODE>
16
<CODE>const int</CODE>
17
<CODE>OPTION</CODE>,
18
<CODE>int *</CODE>
19
<CODE>IRAN</CODE>
20
<CODE>);</CODE>
21

    
22
<H1>Description</H1>
23
<B>HPL_setran</B>
24
initializes  the random generator with the encoding of the
25
first number X(0) in the sequence,  and the constants a and c used to
26
compute the next element in the sequence: X(n+1) = a*X(n) + c.  X(0),
27
a and c are stored in the static variables  irand, ias and ics.  When
28
OPTION is 0 (resp. 1 and 2),  irand  (resp. ia and ic)  is set to the
29
values of the input array IRAN.  When OPTION is 3, IRAN is set to the
30
current value of irand, and irand is then incremented.
31

    
32
<H1>Arguments</H1>
33
<PRE>
34
OPTION  (local input)                 const int
35
        On entry, OPTION  is an integer that specifies the operations
36
        to be performed on the random generator as specified above.
37
</PRE>
38
<PRE>
39
IRAN    (local input/output)          int *
40
        On entry,  IRAN is an array of dimension 2, that contains the
41
        16-lower and 15-higher bits of a random number.
42
</PRE>
43

    
44
<H1>See Also</H1>
45
<A HREF="HPL_ladd.html">HPL_ladd</A>,
46
<A HREF="HPL_lmul.html">HPL_lmul</A>,
47
<A HREF="HPL_xjumpm.html">HPL_xjumpm</A>,
48
<A HREF="HPL_jumpit.html">HPL_jumpit</A>,
49
<A HREF="HPL_rand.html">HPL_rand</A>.
50

    
51
</BODY>
52
</HTML>