LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cchkbk.f
Go to the documentation of this file.
1*> \brief \b CCHKBK
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* SUBROUTINE CCHKBK( NIN, NOUT )
12*
13* .. Scalar Arguments ..
14* INTEGER NIN, NOUT
15* ..
16*
17*
18*> \par Purpose:
19* =============
20*>
21*> \verbatim
22*>
23*> CCHKBK tests CGEBAK, a routine for backward transformation of
24*> the computed right or left eigenvectors if the original matrix
25*> was preprocessed by balance subroutine CGEBAL.
26*> \endverbatim
27*
28* Arguments:
29* ==========
30*
31*> \param[in] NIN
32*> \verbatim
33*> NIN is INTEGER
34*> The logical unit number for input. NIN > 0.
35*> \endverbatim
36*>
37*> \param[in] NOUT
38*> \verbatim
39*> NOUT is INTEGER
40*> The logical unit number for output. NOUT > 0.
41*> \endverbatim
42*
43* Authors:
44* ========
45*
46*> \author Univ. of Tennessee
47*> \author Univ. of California Berkeley
48*> \author Univ. of Colorado Denver
49*> \author NAG Ltd.
50*
51*> \ingroup complex_eig
52*
53* =====================================================================
54 SUBROUTINE cchkbk( NIN, NOUT )
55*
56* -- LAPACK test routine --
57* -- LAPACK is a software package provided by Univ. of Tennessee, --
58* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
59*
60* .. Scalar Arguments ..
61 INTEGER NIN, NOUT
62* ..
63*
64* ======================================================================
65*
66* .. Parameters ..
67 INTEGER LDE
68 parameter( lde = 20 )
69 REAL ZERO
70 parameter( zero = 0.0e0 )
71* ..
72* .. Local Scalars ..
73 INTEGER I, IHI, ILO, INFO, J, KNT, N, NINFO
74 REAL EPS, RMAX, SAFMIN, VMAX, X
75 COMPLEX CDUM
76* ..
77* .. Local Arrays ..
78 INTEGER LMAX( 2 )
79 REAL SCALE( LDE )
80 COMPLEX E( LDE, LDE ), EIN( LDE, LDE )
81* ..
82* .. External Functions ..
83 REAL SLAMCH
84 EXTERNAL slamch
85* ..
86* .. External Subroutines ..
87 EXTERNAL cgebak
88* ..
89* .. Intrinsic Functions ..
90 INTRINSIC abs, aimag, max, real
91* ..
92* .. Statement Functions ..
93 REAL CABS1
94* ..
95* .. Statement Function definitions ..
96 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
97* ..
98* .. Executable Statements ..
99*
100 lmax( 1 ) = 0
101 lmax( 2 ) = 0
102 ninfo = 0
103 knt = 0
104 rmax = zero
105 eps = slamch( 'E' )
106 safmin = slamch( 'S' )
107*
108 10 CONTINUE
109*
110 READ( nin, fmt = * )n, ilo, ihi
111 IF( n.EQ.0 )
112 $ GO TO 60
113*
114 READ( nin, fmt = * )( scale( i ), i = 1, n )
115 DO 20 i = 1, n
116 READ( nin, fmt = * )( e( i, j ), j = 1, n )
117 20 CONTINUE
118*
119 DO 30 i = 1, n
120 READ( nin, fmt = * )( ein( i, j ), j = 1, n )
121 30 CONTINUE
122*
123 knt = knt + 1
124 CALL cgebak( 'B', 'R', n, ilo, ihi, scale, n, e, lde, info )
125*
126 IF( info.NE.0 ) THEN
127 ninfo = ninfo + 1
128 lmax( 1 ) = knt
129 END IF
130*
131 vmax = zero
132 DO 50 i = 1, n
133 DO 40 j = 1, n
134 x = cabs1( e( i, j )-ein( i, j ) ) / eps
135 IF( cabs1( e( i, j ) ).GT.safmin )
136 $ x = x / cabs1( e( i, j ) )
137 vmax = max( vmax, x )
138 40 CONTINUE
139 50 CONTINUE
140*
141 IF( vmax.GT.rmax ) THEN
142 lmax( 2 ) = knt
143 rmax = vmax
144 END IF
145*
146 GO TO 10
147*
148 60 CONTINUE
149*
150 WRITE( nout, fmt = 9999 )
151 9999 FORMAT( 1x, '.. test output of CGEBAK .. ' )
152*
153 WRITE( nout, fmt = 9998 )rmax
154 9998 FORMAT( 1x, 'value of largest test error = ', e12.3 )
155 WRITE( nout, fmt = 9997 )lmax( 1 )
156 9997 FORMAT( 1x, 'example number where info is not zero = ', i4 )
157 WRITE( nout, fmt = 9996 )lmax( 2 )
158 9996 FORMAT( 1x, 'example number having largest error = ', i4 )
159 WRITE( nout, fmt = 9995 )ninfo
160 9995 FORMAT( 1x, 'number of examples where info is not 0 = ', i4 )
161 WRITE( nout, fmt = 9994 )knt
162 9994 FORMAT( 1x, 'total number of examples tested = ', i4 )
163*
164 RETURN
165*
166* End of CCHKBK
167*
168 END
subroutine cchkbk(nin, nout)
CCHKBK
Definition cchkbk.f:55
subroutine cgebak(job, side, n, ilo, ihi, scale, m, v, ldv, info)
CGEBAK
Definition cgebak.f:131