LAPACK  3.10.0
LAPACK: Linear Algebra PACKage
zslect.f
Go to the documentation of this file.
1 *> \brief \b ZSLECT
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * LOGICAL FUNCTION ZSLECT( Z )
12 *
13 * .. Scalar Arguments ..
14 * COMPLEX*16 Z
15 * ..
16 *
17 *
18 *> \par Purpose:
19 * =============
20 *>
21 *> \verbatim
22 *>
23 *> ZSLECT returns .TRUE. if the eigenvalue Z is to be selected,
24 *> otherwise it returns .FALSE.
25 *> It is used by ZCHK41 to test if ZGEES successfully sorts eigenvalues,
26 *> and by ZCHK43 to test if ZGEESX successfully sorts eigenvalues.
27 *>
28 *> The common block /SSLCT/ controls how eigenvalues are selected.
29 *> If SELOPT = 0, then ZSLECT return .TRUE. when real(Z) is less than
30 *> zero, and .FALSE. otherwise.
31 *> If SELOPT is at least 1, ZSLECT returns SELVAL(SELOPT) and adds 1
32 *> to SELOPT, cycling back to 1 at SELMAX.
33 *> \endverbatim
34 *
35 * Arguments:
36 * ==========
37 *
38 *> \param[in] Z
39 *> \verbatim
40 *> Z is COMPLEX*16
41 *> The eigenvalue Z.
42 *> \endverbatim
43 *
44 * Authors:
45 * ========
46 *
47 *> \author Univ. of Tennessee
48 *> \author Univ. of California Berkeley
49 *> \author Univ. of Colorado Denver
50 *> \author NAG Ltd.
51 *
52 *> \ingroup complex16_eig
53 *
54 * =====================================================================
55  LOGICAL FUNCTION zslect( Z )
56 *
57 * -- LAPACK test routine --
58 * -- LAPACK is a software package provided by Univ. of Tennessee, --
59 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
60 *
61 * .. Scalar Arguments ..
62  COMPLEX*16 z
63 * ..
64 *
65 * =====================================================================
66 *
67 * .. Parameters ..
68  DOUBLE PRECISION zero
69  parameter( zero = 0.0d0 )
70 * ..
71 * .. Local Scalars ..
72  INTEGER i
73  DOUBLE PRECISION rmin, x
74 * ..
75 * .. Scalars in Common ..
76  INTEGER seldim, selopt
77 * ..
78 * .. Arrays in Common ..
79  LOGICAL selval( 20 )
80  DOUBLE PRECISION selwi( 20 ), selwr( 20 )
81 * ..
82 * .. Common blocks ..
83  COMMON / sslct / selopt, seldim, selval, selwr, selwi
84 * ..
85 * .. Intrinsic Functions ..
86  INTRINSIC abs, dble, dcmplx
87 * ..
88 * .. Executable Statements ..
89 *
90  IF( selopt.EQ.0 ) THEN
91  zslect = ( dble( z ).LT.zero )
92  ELSE
93  rmin = abs( z-dcmplx( selwr( 1 ), selwi( 1 ) ) )
94  zslect = selval( 1 )
95  DO 10 i = 2, seldim
96  x = abs( z-dcmplx( selwr( i ), selwi( i ) ) )
97  IF( x.LE.rmin ) THEN
98  rmin = x
99  zslect = selval( i )
100  END IF
101  10 CONTINUE
102  END IF
103  RETURN
104 *
105 * End of ZSLECT
106 *
107  END
logical function zslect(Z)
ZSLECT
Definition: zslect.f:56