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

◆ pb_sran()

real function pb_sran ( integer  idumm)

Definition at line 10441 of file psblastst.f.

10442*
10443* -- PBLAS test routine (version 2.0) --
10444* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
10445* and University of California, Berkeley.
10446* April 1, 1998
10447*
10448* .. Scalar Arguments ..
10449 INTEGER IDUMM
10450* ..
10451*
10452* Purpose
10453* =======
10454*
10455* PB_SRAN generates the next number in the random sequence.
10456*
10457* Arguments
10458* =========
10459*
10460* IDUMM (local input) INTEGER
10461* This argument is ignored, but necessary to a FORTRAN 77 func-
10462* tion.
10463*
10464* Further Details
10465* ===============
10466*
10467* On entry, the array IRAND stored in the common block RANCOM contains
10468* the information (2 integers) required to generate the next number in
10469* the sequence X( n ). This number is computed as
10470*
10471* X( n ) = ( 2^16 * IRAND( 2 ) + IRAND( 1 ) ) / d,
10472*
10473* where the constant d is the largest 32 bit positive integer. The
10474* array IRAND is then updated for the generation of the next number
10475* X( n+1 ) in the random sequence as follows X( n+1 ) = a * X( n ) + c.
10476* The constants a and c should have been preliminarily stored in the
10477* array IACS as 2 pairs of integers. The initial set up of IRAND and
10478* IACS is performed by the routine PB_SETRAN.
10479*
10480* -- Written on April 1, 1998 by
10481* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
10482*
10483* =====================================================================
10484*
10485* .. Parameters ..
10486 REAL DIVFAC, POW16
10487 parameter( divfac = 2.147483648e+9,
10488 $ pow16 = 6.5536e+4 )
10489* ..
10490* .. Local Arrays ..
10491 INTEGER J( 2 )
10492* ..
10493* .. External Subroutines ..
10494 EXTERNAL pb_ladd, pb_lmul
10495* ..
10496* .. Intrinsic Functions ..
10497 INTRINSIC real
10498* ..
10499* .. Common Blocks ..
10500 INTEGER IACS( 4 ), IRAND( 2 )
10501 COMMON /rancom/ irand, iacs
10502* ..
10503* .. Save Statements ..
10504 SAVE /rancom/
10505* ..
10506* .. Executable Statements ..
10507*
10508 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
10509 $ divfac
10510*
10511 CALL pb_lmul( irand, iacs, j )
10512 CALL pb_ladd( j, iacs( 3 ), irand )
10513*
10514 RETURN
10515*
10516* End of PB_SRAN
10517*
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: