LAPACK 3.12.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches
sslect.f
Go to the documentation of this file.
1*> \brief \b SSLECT
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 SSLECT( ZR, ZI )
12*
13* .. Scalar Arguments ..
14* REAL ZI, ZR
15* ..
16*
17*
18*> \par Purpose:
19* =============
20*>
21*> \verbatim
22*>
23*> SSLECT returns .TRUE. if the eigenvalue ZR+sqrt(-1)*ZI is to be
24*> selected, and otherwise it returns .FALSE.
25*> It is used by SCHK41 to test if SGEES successfully sorts eigenvalues,
26*> and by SCHK43 to test if SGEESX successfully sorts eigenvalues.
27*>
28*> The common block /SSLCT/ controls how eigenvalues are selected.
29*> If SELOPT = 0, then SSLECT return .TRUE. when ZR is less than zero,
30*> and .FALSE. otherwise.
31*> If SELOPT is at least 1, SSLECT 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 REAL
41*> The real part of a complex eigenvalue ZR + i*ZI.
42*> \endverbatim
43*>
44*> \param[in] ZI
45*> \verbatim
46*> ZI is REAL
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 single_eig
59*
60* =====================================================================
61 LOGICAL FUNCTION sslect( 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 REAL zi, zr
69* ..
70*
71* =====================================================================
72*
73* .. Arrays in Common ..
74 LOGICAL selval( 20 )
75 REAL 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 REAL rmin, x
86* ..
87* .. Parameters ..
88 REAL zero
89 parameter( zero = 0.0e0 )
90* ..
91* .. External Functions ..
92 REAL slapy2
93 EXTERNAL slapy2
94* ..
95* .. Executable Statements ..
96*
97 IF( selopt.EQ.0 ) THEN
98 sslect = ( zr.LT.zero )
99 ELSE
100 rmin = slapy2( zr-selwr( 1 ), zi-selwi( 1 ) )
101 sslect = selval( 1 )
102 DO 10 i = 2, seldim
103 x = slapy2( zr-selwr( i ), zi-selwi( i ) )
104 IF( x.LE.rmin ) THEN
105 rmin = x
106 sslect = selval( i )
107 END IF
108 10 CONTINUE
109 END IF
110 RETURN
111*
112* End of SSLECT
113*
114 END
real function slapy2(x, y)
SLAPY2 returns sqrt(x2+y2).
Definition slapy2.f:63
logical function sslect(zr, zi)
SSLECT
Definition sslect.f:62