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

◆ pb_sran()

real function pb_sran ( integer  idumm)

Definition at line 2182 of file psblastim.f.

2183*
2184* -- PBLAS test routine (version 2.0) --
2185* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
2186* and University of California, Berkeley.
2187* April 1, 1998
2188*
2189* .. Scalar Arguments ..
2190 INTEGER IDUMM
2191* ..
2192*
2193* Purpose
2194* =======
2195*
2196* PB_SRAN generates the next number in the random sequence.
2197*
2198* Arguments
2199* =========
2200*
2201* IDUMM (local input) INTEGER
2202* This argument is ignored, but necessary to a FORTRAN 77 func-
2203* tion.
2204*
2205* Further Details
2206* ===============
2207*
2208* On entry, the array IRAND stored in the common block RANCOM contains
2209* the information (2 integers) required to generate the next number in
2210* the sequence X( n ). This number is computed as
2211*
2212* X( n ) = ( 2^16 * IRAND( 2 ) + IRAND( 1 ) ) / d,
2213*
2214* where the constant d is the largest 32 bit positive integer. The
2215* array IRAND is then updated for the generation of the next number
2216* X( n+1 ) in the random sequence as follows X( n+1 ) = a * X( n ) + c.
2217* The constants a and c should have been preliminarily stored in the
2218* array IACS as 2 pairs of integers. The initial set up of IRAND and
2219* IACS is performed by the routine PB_SETRAN.
2220*
2221* -- Written on April 1, 1998 by
2222* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
2223*
2224* =====================================================================
2225*
2226* .. Parameters ..
2227 REAL DIVFAC, POW16
2228 parameter( divfac = 2.147483648e+9,
2229 $ pow16 = 6.5536e+4 )
2230* ..
2231* .. Local Arrays ..
2232 INTEGER J( 2 )
2233* ..
2234* .. External Subroutines ..
2235 EXTERNAL pb_ladd, pb_lmul
2236* ..
2237* .. Intrinsic Functions ..
2238 INTRINSIC real
2239* ..
2240* .. Common Blocks ..
2241 INTEGER IACS( 4 ), IRAND( 2 )
2242 COMMON /rancom/ irand, iacs
2243* ..
2244* .. Save Statements ..
2245 SAVE /rancom/
2246* ..
2247* .. Executable Statements ..
2248*
2249 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
2250 $ divfac
2251*
2252 CALL pb_lmul( irand, iacs, j )
2253 CALL pb_ladd( j, iacs( 3 ), irand )
2254*
2255 RETURN
2256*
2257* End of PB_SRAN
2258*
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: