root / man / man3 / HPL_setran.3 @ 1
Historique | Voir | Annoter | Télécharger (1,2 ko)
1 |
.TH HPL_setran 3 "September 10, 2008" "HPL 2.0" "HPL Library Functions" |
---|---|
2 |
.SH NAME |
3 |
HPL_setran \- Manage the random number generator. |
4 |
.SH SYNOPSIS |
5 |
\fB\&#include "hpl.h"\fR |
6 |
|
7 |
\fB\&void\fR |
8 |
\fB\&HPL_setran(\fR |
9 |
\fB\&const int\fR |
10 |
\fI\&OPTION\fR, |
11 |
\fB\&int *\fR |
12 |
\fI\&IRAN\fR |
13 |
\fB\&);\fR |
14 |
.SH DESCRIPTION |
15 |
\fB\&HPL_setran\fR |
16 |
initializes the random generator with the encoding of the |
17 |
first number X(0) in the sequence, and the constants a and c used to |
18 |
compute the next element in the sequence: X(n+1) = a*X(n) + c. X(0), |
19 |
a and c are stored in the static variables irand, ias and ics. When |
20 |
OPTION is 0 (resp. 1 and 2), irand (resp. ia and ic) is set to the |
21 |
values of the input array IRAN. When OPTION is 3, IRAN is set to the |
22 |
current value of irand, and irand is then incremented. |
23 |
.SH ARGUMENTS |
24 |
.TP 8 |
25 |
OPTION (local input) const int |
26 |
On entry, OPTION is an integer that specifies the operations |
27 |
to be performed on the random generator as specified above. |
28 |
.TP 8 |
29 |
IRAN (local input/output) int * |
30 |
On entry, IRAN is an array of dimension 2, that contains the |
31 |
16-lower and 15-higher bits of a random number. |
32 |
.SH SEE ALSO |
33 |
.BR HPL_ladd \ (3), |
34 |
.BR HPL_lmul \ (3), |
35 |
.BR HPL_xjumpm \ (3), |
36 |
.BR HPL_jumpit \ (3), |
37 |
.BR HPL_rand \ (3). |