ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pslamch.f
Go to the documentation of this file.
1  REAL FUNCTION PSLAMCH( ICTXT, CMACH )
2 *
3 * -- ScaLAPACK auxiliary routine (version 1.7) --
4 * University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5 * and University of California, Berkeley.
6 * May 1, 1997
7 *
8 * .. Scalar Arguments ..
9  CHARACTER cmach
10  INTEGER ictxt
11 * ..
12 *
13 * Purpose
14 * =======
15 *
16 * PSLAMCH determines single precision machine parameters.
17 *
18 * Arguments
19 * =========
20 *
21 * ICTXT (global input) INTEGER
22 * The BLACS context handle in which the computation takes
23 * place.
24 *
25 * CMACH (global input) CHARACTER*1
26 * Specifies the value to be returned by PSLAMCH:
27 * = 'E' or 'e', PSLAMCH := eps
28 * = 'S' or 's , PSLAMCH := sfmin
29 * = 'B' or 'b', PSLAMCH := base
30 * = 'P' or 'p', PSLAMCH := eps*base
31 * = 'N' or 'n', PSLAMCH := t
32 * = 'R' or 'r', PSLAMCH := rnd
33 * = 'M' or 'm', PSLAMCH := emin
34 * = 'U' or 'u', PSLAMCH := rmin
35 * = 'L' or 'l', PSLAMCH := emax
36 * = 'O' or 'o', PSLAMCH := rmax
37 *
38 * where
39 *
40 * eps = relative machine precision
41 * sfmin = safe minimum, such that 1/sfmin does not overflow
42 * base = base of the machine
43 * prec = eps*base
44 * t = number of (base) digits in the mantissa
45 * rnd = 1.0 when rounding occurs in addition, 0.0 otherwise
46 * emin = minimum exponent before (gradual) underflow
47 * rmin = underflow threshold - base**(emin-1)
48 * emax = largest exponent before overflow
49 * rmax = overflow threshold - (base**emax)*(1-eps)
50 *
51 * =====================================================================
52 *
53 * .. Local Scalars ..
54  INTEGER idumm
55  REAL temp
56 * ..
57 * .. External Subroutines ..
58  EXTERNAL sgamn2d, sgamx2d
59 * ..
60 * .. External Functions ..
61  LOGICAL lsame
62  REAL slamch
63  EXTERNAL lsame, slamch
64 * ..
65 * .. Executable Statements ..
66 *
67  temp = slamch( cmach )
68  idumm = 0
69 *
70  IF( lsame( cmach, 'E' ).OR.lsame( cmach, 'S' ).OR.
71  $ lsame( cmach, 'M' ).OR.lsame( cmach, 'U' ) ) THEN
72  CALL sgamx2d( ictxt, 'All', ' ', 1, 1, temp, 1, idumm,
73  $ idumm, -1, -1, idumm )
74  ELSE IF( lsame( cmach, 'L' ).OR.lsame( cmach, 'O' ) ) THEN
75  CALL sgamn2d( ictxt, 'All', ' ', 1, 1, temp, 1, idumm,
76  $ idumm, -1, -1, idumm )
77  END IF
78 *
79  pslamch = temp
80 *
81 * End of PSLAMCH
82 *
83  END
pslamch
real function pslamch(ICTXT, CMACH)
Definition: pcblastst.f:7455
lsame
logical function lsame(CA, CB)
Definition: tools.f:1724
slamch
real function slamch(CMACH)
Definition: tools.f:867