LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dslect()

logical function dslect ( double precision  ZR,
double precision  ZI 
)

DSLECT

Purpose:
 DSLECT returns .TRUE. if the eigenvalue ZR+sqrt(-1)*ZI is to be
 selected, and otherwise it returns .FALSE.
 It is used by DCHK41 to test if DGEES successfully sorts eigenvalues,
 and by DCHK43 to test if DGEESX successfully sorts eigenvalues.

 The common block /SSLCT/ controls how eigenvalues are selected.
 If SELOPT = 0, then DSLECT return .TRUE. when ZR is less than zero,
 and .FALSE. otherwise.
 If SELOPT is at least 1, DSLECT returns SELVAL(SELOPT) and adds 1
 to SELOPT, cycling back to 1 at SELMAX.
Parameters
[in]ZR
          ZR is DOUBLE PRECISION
          The real part of a complex eigenvalue ZR + i*ZI.
[in]ZI
          ZI is DOUBLE PRECISION
          The imaginary part of a complex eigenvalue ZR + i*ZI.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
June 2016

Definition at line 64 of file dslect.f.

64 *
65 * -- LAPACK test routine (version 3.7.0) --
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 *
logical function dslect(ZR, ZI)
DSLECT
Definition: dslect.f:64
double precision function dlapy2(X, Y)
DLAPY2 returns sqrt(x2+y2).
Definition: dlapy2.f:65