LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
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*> \ingroup double_eig
59*
60* =====================================================================
61 LOGICAL FUNCTION dslect( ZR, ZI )
62*
63* -- LAPACK test routine --
64* -- LAPACK is a software package provided by Univ. of Tennessee, --
65* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
66*
67* .. Scalar Arguments ..
68 DOUBLE PRECISION zi, zr
69* ..
70*
71* =====================================================================
72*
73* .. Arrays in Common ..
74 LOGICAL selval( 20 )
75 DOUBLE PRECISION selwi( 20 ), selwr( 20 )
76* ..
77* .. Scalars in Common ..
78 INTEGER seldim, selopt
79* ..
80* .. Common blocks ..
81 COMMON / sslct / selopt, seldim, selval, selwr, selwi
82* ..
83* .. Local Scalars ..
84 INTEGER i
85 DOUBLE PRECISION rmin, x
86* ..
87* .. Parameters ..
88 DOUBLE PRECISION zero
89 parameter( zero = 0.0d0 )
90* ..
91* .. External Functions ..
92 DOUBLE PRECISION dlapy2
93 EXTERNAL dlapy2
94* ..
95* .. Executable Statements ..
96*
97 IF( selopt.EQ.0 ) THEN
98 dslect = ( zr.LT.zero )
99 ELSE
100 rmin = dlapy2( zr-selwr( 1 ), zi-selwi( 1 ) )
101 dslect = selval( 1 )
102 DO 10 i = 2, seldim
103 x = dlapy2( zr-selwr( i ), zi-selwi( i ) )
104 IF( x.LE.rmin ) THEN
105 rmin = x
106 dslect = selval( i )
107 END IF
108 10 CONTINUE
109 END IF
110 RETURN
111*
112* End of DSLECT
113*
114 END
logical function dslect(zr, zi)
DSLECT
Definition dslect.f:62
double precision function dlapy2(x, y)
DLAPY2 returns sqrt(x2+y2).
Definition dlapy2.f:63