LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
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 succesfully sorts eigenvalues,
26 *> and by ZCHK43 to test if ZGEESX succesfully 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 *> \date November 2011
53 *
54 *> \ingroup complex16_eig
55 *
56 * =====================================================================
57  LOGICAL FUNCTION zslect( Z )
58 *
59 * -- LAPACK test routine (version 3.4.0) --
60 * -- LAPACK is a software package provided by Univ. of Tennessee, --
61 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
62 * November 2011
63 *
64 * .. Scalar Arguments ..
65  COMPLEX*16 z
66 * ..
67 *
68 * =====================================================================
69 *
70 * .. Parameters ..
71  DOUBLE PRECISION zero
72  parameter( zero = 0.0d0 )
73 * ..
74 * .. Local Scalars ..
75  INTEGER i
76  DOUBLE PRECISION rmin, x
77 * ..
78 * .. Scalars in Common ..
79  INTEGER seldim, selopt
80 * ..
81 * .. Arrays in Common ..
82  LOGICAL selval( 20 )
83  DOUBLE PRECISION selwi( 20 ), selwr( 20 )
84 * ..
85 * .. Common blocks ..
86  common / sslct / selopt, seldim, selval, selwr, selwi
87 * ..
88 * .. Intrinsic Functions ..
89  INTRINSIC abs, dble, dcmplx
90 * ..
91 * .. Executable Statements ..
92 *
93  IF( selopt.EQ.0 ) THEN
94  zslect = ( dble( z ).LT.zero )
95  ELSE
96  rmin = abs( z-dcmplx( selwr( 1 ), selwi( 1 ) ) )
97  zslect = selval( 1 )
98  DO 10 i = 2, seldim
99  x = abs( z-dcmplx( selwr( i ), selwi( i ) ) )
100  IF( x.LE.rmin ) THEN
101  rmin = x
102  zslect = selval( i )
103  END IF
104  10 continue
105  END IF
106  return
107 *
108 * End of ZSLECT
109 *
110  END