Statistiques
| Révision :

root / man / man3 / HPL_rand.3 @ 1

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

1
.TH HPL_rand 3 "September 10, 2008" "HPL 2.0" "HPL Library Functions"
2
.SH NAME
3
HPL_rand \- random number generator.
4
.SH SYNOPSIS
5
\fB\&#include "hpl.h"\fR
6
 
7
\fB\&double\fR
8
\fB\&HPL_rand();\fR
9
.SH DESCRIPTION
10
\fB\&HPL_rand\fR
11
generates  the next number  in the  random  sequence.  This
12
function  ensures  that this number lies in the interval (-0.5, 0.5].
13
 
14
The static array irand contains the information (2 integers) required
15
to generate the  next number  in the sequence  X(n).  This  number is
16
computed as X(n) = (2^16 * irand[1] + irand[0]) / d - 0.5,  where the
17
constant d is the largest 32 bit positive integer. The array irand is
18
then  updated  for the generation of the next number  X(n+1)  in  the
19
random sequence as follows X(n+1) = a * X(n) + c. The constants a and
20
c  should have been preliminarily stored in the arrays ias and ics as
21
2 pairs of integers.  The initialization of  ias,  ics and  irand  is
22
performed by the function HPL_setran.
23
.SH SEE ALSO
24
.BR HPL_ladd \ (3),
25
.BR HPL_lmul \ (3),
26
.BR HPL_setran \ (3),
27
.BR HPL_xjumpm \ (3),
28
.BR HPL_jumpit \ (3).