LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
cslect.f
Go to the documentation of this file.
1 *> \brief \b CSLECT
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 CSLECT( Z )
12 *
13 * .. Scalar Arguments ..
14 * COMPLEX Z
15 * ..
16 *
17 *
18 *> \par Purpose:
19 * =============
20 *>
21 *> \verbatim
22 *>
23 *> CSLECT returns .TRUE. if the eigenvalue Z is to be selected,
24 *> otherwise it returns .FALSE.
25 *> It is used by CCHK41 to test if CGEES succesfully sorts eigenvalues,
26 *> and by CCHK43 to test if CGEESX succesfully sorts eigenvalues.
27 *>
28 *> The common block /SSLCT/ controls how eigenvalues are selected.
29 *> If SELOPT = 0, then CSLECT return .TRUE. when real(Z) is less than
30 *> zero, and .FALSE. otherwise.
31 *> If SELOPT is at least 1, CSLECT 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
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 complex_eig
55 *
56 * =====================================================================
57  LOGICAL FUNCTION cslect( 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 z
66 * ..
67 *
68 * =====================================================================
69 *
70 * .. Parameters ..
71  REAL zero
72  parameter( zero = 0.0e0 )
73 * ..
74 * .. Local Scalars ..
75  INTEGER i
76  REAL rmin, x
77 * ..
78 * .. Scalars in Common ..
79  INTEGER seldim, selopt
80 * ..
81 * .. Arrays in Common ..
82  LOGICAL selval( 20 )
83  REAL selwi( 20 ), selwr( 20 )
84 * ..
85 * .. Common blocks ..
86  common / sslct / selopt, seldim, selval, selwr, selwi
87 * ..
88 * .. Intrinsic Functions ..
89  INTRINSIC abs, cmplx, real
90 * ..
91 * .. Executable Statements ..
92 *
93  IF( selopt.EQ.0 ) THEN
94  cslect = ( REAL( z ).LT.zero )
95  ELSE
96  rmin = abs( z-cmplx( selwr( 1 ), selwi( 1 ) ) )
97  cslect = selval( 1 )
98  DO 10 i = 2, seldim
99  x = abs( z-cmplx( selwr( i ), selwi( i ) ) )
100  IF( x.LE.rmin ) THEN
101  rmin = x
102  cslect = selval( i )
103  END IF
104  10 continue
105  END IF
106  return
107 *
108 * End of CSLECT
109 *
110  END