SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_sran()

real function pb_sran ( integer  idumm)

Definition at line 11551 of file pcblastst.f.

11552*
11553* -- PBLAS test routine (version 2.0) --
11554* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
11555* and University of California, Berkeley.
11556* April 1, 1998
11557*
11558* .. Scalar Arguments ..
11559 INTEGER IDUMM
11560* ..
11561*
11562* Purpose
11563* =======
11564*
11565* PB_SRAN generates the next number in the random sequence.
11566*
11567* Arguments
11568* =========
11569*
11570* IDUMM (local input) INTEGER
11571* This argument is ignored, but necessary to a FORTRAN 77 func-
11572* tion.
11573*
11574* Further Details
11575* ===============
11576*
11577* On entry, the array IRAND stored in the common block RANCOM contains
11578* the information (2 integers) required to generate the next number in
11579* the sequence X( n ). This number is computed as
11580*
11581* X( n ) = ( 2^16 * IRAND( 2 ) + IRAND( 1 ) ) / d,
11582*
11583* where the constant d is the largest 32 bit positive integer. The
11584* array IRAND is then updated for the generation of the next number
11585* X( n+1 ) in the random sequence as follows X( n+1 ) = a * X( n ) + c.
11586* The constants a and c should have been preliminarily stored in the
11587* array IACS as 2 pairs of integers. The initial set up of IRAND and
11588* IACS is performed by the routine PB_SETRAN.
11589*
11590* -- Written on April 1, 1998 by
11591* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
11592*
11593* =====================================================================
11594*
11595* .. Parameters ..
11596 REAL DIVFAC, POW16
11597 parameter( divfac = 2.147483648e+9,
11598 $ pow16 = 6.5536e+4 )
11599* ..
11600* .. Local Arrays ..
11601 INTEGER J( 2 )
11602* ..
11603* .. External Subroutines ..
11604 EXTERNAL pb_ladd, pb_lmul
11605* ..
11606* .. Intrinsic Functions ..
11607 INTRINSIC real
11608* ..
11609* .. Common Blocks ..
11610 INTEGER IACS( 4 ), IRAND( 2 )
11611 COMMON /rancom/ irand, iacs
11612* ..
11613* .. Save Statements ..
11614 SAVE /rancom/
11615* ..
11616* .. Executable Statements ..
11617*
11618 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
11619 $ divfac
11620*
11621 CALL pb_lmul( irand, iacs, j )
11622 CALL pb_ladd( j, iacs( 3 ), irand )
11623*
11624 RETURN
11625*
11626* End of PB_SRAN
11627*
subroutine pb_ladd(j, k, i)
Definition pblastst.f:4480
subroutine pb_lmul(k, j, i)
Definition pblastst.f:4559
real function pb_sran(idumm)
Here is the call graph for this function:
Here is the caller graph for this function: