LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
dslect.f
Go to the documentation of this file.
1 *> \brief \b DSLECT
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 DSLECT( ZR, ZI )
12 *
13 * .. Scalar Arguments ..
14 * DOUBLE PRECISION ZI, ZR
15 * ..
16 *
17 *
18 *> \par Purpose:
19 * =============
20 *>
21 *> \verbatim
22 *>
23 *> DSLECT returns .TRUE. if the eigenvalue ZR+sqrt(-1)*ZI is to be
24 *> selected, and otherwise it returns .FALSE.
25 *> It is used by DCHK41 to test if DGEES successfully sorts eigenvalues,
26 *> and by DCHK43 to test if DGEESX successfully sorts eigenvalues.
27 *>
28 *> The common block /SSLCT/ controls how eigenvalues are selected.
29 *> If SELOPT = 0, then DSLECT return .TRUE. when ZR is less than zero,
30 *> and .FALSE. otherwise.
31 *> If SELOPT is at least 1, DSLECT 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] ZR
39 *> \verbatim
40 *> ZR is DOUBLE PRECISION
41 *> The real part of a complex eigenvalue ZR + i*ZI.
42 *> \endverbatim
43 *>
44 *> \param[in] ZI
45 *> \verbatim
46 *> ZI is DOUBLE PRECISION
47 *> The imaginary part of a complex eigenvalue ZR + i*ZI.
48 *> \endverbatim
49 *
50 * Authors:
51 * ========
52 *
53 *> \author Univ. of Tennessee
54 *> \author Univ. of California Berkeley
55 *> \author Univ. of Colorado Denver
56 *> \author NAG Ltd.
57 *
58 *> \date June 2016
59 *
60 *> \ingroup double_eig
61 *
62 * =====================================================================
63  LOGICAL FUNCTION dslect( ZR, ZI )
64 *
65 * -- LAPACK test routine (version 3.6.1) --
66 * -- LAPACK is a software package provided by Univ. of Tennessee, --
67 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
68 * June 2016
69 *
70 * .. Scalar Arguments ..
71  DOUBLE PRECISION ZI, ZR
72 * ..
73 *
74 * =====================================================================
75 *
76 * .. Arrays in Common ..
77  LOGICAL SELVAL( 20 )
78  DOUBLE PRECISION SELWI( 20 ), SELWR( 20 )
79 * ..
80 * .. Scalars in Common ..
81  INTEGER SELDIM, SELOPT
82 * ..
83 * .. Common blocks ..
84  COMMON / sslct / selopt, seldim, selval, selwr, selwi
85 * ..
86 * .. Local Scalars ..
87  INTEGER I
88  DOUBLE PRECISION RMIN, X
89 * ..
90 * .. Parameters ..
91  DOUBLE PRECISION ZERO
92  parameter ( zero = 0.0d0 )
93 * ..
94 * .. External Functions ..
95  DOUBLE PRECISION DLAPY2
96  EXTERNAL dlapy2
97 * ..
98 * .. Executable Statements ..
99 *
100  IF( selopt.EQ.0 ) THEN
101  dslect = ( zr.LT.zero )
102  ELSE
103  rmin = dlapy2( zr-selwr( 1 ), zi-selwi( 1 ) )
104  dslect = selval( 1 )
105  DO 10 i = 2, seldim
106  x = dlapy2( zr-selwr( i ), zi-selwi( i ) )
107  IF( x.LE.rmin ) THEN
108  rmin = x
109  dslect = selval( i )
110  END IF
111  10 CONTINUE
112  END IF
113  RETURN
114 *
115 * End of DSLECT
116 *
117  END
logical function dslect(ZR, ZI)
DSLECT
Definition: dslect.f:64