LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
schkbk.f
Go to the documentation of this file.
1 *> \brief \b SCHKBK
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 SCHKBK( NIN, NOUT )
12 *
13 * .. Scalar Arguments ..
14 * INTEGER NIN, NOUT
15 * ..
16 *
17 *
18 *> \par Purpose:
19 * =============
20 *>
21 *> \verbatim
22 *>
23 *> SCHKBK tests SGEBAK, a routine for backward transformation of
24 *> the computed right or left eigenvectors if the orginal matrix
25 *> was preprocessed by balance subroutine SGEBAL.
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 *> \date November 2011
52 *
53 *> \ingroup single_eig
54 *
55 * =====================================================================
56  SUBROUTINE schkbk( NIN, NOUT )
57 *
58 * -- LAPACK test routine (version 3.4.0) --
59 * -- LAPACK is a software package provided by Univ. of Tennessee, --
60 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
61 * November 2011
62 *
63 * .. Scalar Arguments ..
64  INTEGER NIN, NOUT
65 * ..
66 *
67 * ======================================================================
68 *
69 * .. Parameters ..
70  INTEGER LDE
71  parameter ( lde = 20 )
72  REAL ZERO
73  parameter ( zero = 0.0e0 )
74 * ..
75 * .. Local Scalars ..
76  INTEGER I, IHI, ILO, INFO, J, KNT, N, NINFO
77  REAL EPS, RMAX, SAFMIN, VMAX, X
78 * ..
79 * .. Local Arrays ..
80  INTEGER LMAX( 2 )
81  REAL E( lde, lde ), EIN( lde, lde ), SCALE( lde )
82 * ..
83 * .. External Functions ..
84  REAL SLAMCH
85  EXTERNAL slamch
86 * ..
87 * .. External Subroutines ..
88  EXTERNAL sgebak
89 * ..
90 * .. Intrinsic Functions ..
91  INTRINSIC abs, max
92 * ..
93 * .. Executable Statements ..
94 *
95  lmax( 1 ) = 0
96  lmax( 2 ) = 0
97  ninfo = 0
98  knt = 0
99  rmax = zero
100  eps = slamch( 'E' )
101  safmin = slamch( 'S' )
102 *
103  10 CONTINUE
104 *
105  READ( nin, fmt = * )n, ilo, ihi
106  IF( n.EQ.0 )
107  $ GO TO 60
108 *
109  READ( nin, fmt = * )( scale( i ), i = 1, n )
110  DO 20 i = 1, n
111  READ( nin, fmt = * )( e( i, j ), j = 1, n )
112  20 CONTINUE
113 *
114  DO 30 i = 1, n
115  READ( nin, fmt = * )( ein( i, j ), j = 1, n )
116  30 CONTINUE
117 *
118  knt = knt + 1
119  CALL sgebak( 'B', 'R', n, ilo, ihi, scale, n, e, lde, info )
120 *
121  IF( info.NE.0 ) THEN
122  ninfo = ninfo + 1
123  lmax( 1 ) = knt
124  END IF
125 *
126  vmax = zero
127  DO 50 i = 1, n
128  DO 40 j = 1, n
129  x = abs( e( i, j )-ein( i, j ) ) / eps
130  IF( abs( e( i, j ) ).GT.safmin )
131  $ x = x / abs( e( i, j ) )
132  vmax = max( vmax, x )
133  40 CONTINUE
134  50 CONTINUE
135 *
136  IF( vmax.GT.rmax ) THEN
137  lmax( 2 ) = knt
138  rmax = vmax
139  END IF
140 *
141  GO TO 10
142 *
143  60 CONTINUE
144 *
145  WRITE( nout, fmt = 9999 )
146  9999 FORMAT( 1x, '.. test output of SGEBAK .. ' )
147 *
148  WRITE( nout, fmt = 9998 )rmax
149  9998 FORMAT( 1x, 'value of largest test error = ', e12.3 )
150  WRITE( nout, fmt = 9997 )lmax( 1 )
151  9997 FORMAT( 1x, 'example number where info is not zero = ', i4 )
152  WRITE( nout, fmt = 9996 )lmax( 2 )
153  9996 FORMAT( 1x, 'example number having largest error = ', i4 )
154  WRITE( nout, fmt = 9995 )ninfo
155  9995 FORMAT( 1x, 'number of examples where info is not 0 = ', i4 )
156  WRITE( nout, fmt = 9994 )knt
157  9994 FORMAT( 1x, 'total number of examples tested = ', i4 )
158 *
159  RETURN
160 *
161 * End of SCHKBK
162 *
163  END
subroutine schkbk(NIN, NOUT)
SCHKBK
Definition: schkbk.f:57
subroutine sgebak(JOB, SIDE, N, ILO, IHI, SCALE, M, V, LDV, INFO)
SGEBAK
Definition: sgebak.f:132