LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ cchkbl()

subroutine cchkbl ( integer  NIN,
integer  NOUT 
)

CCHKBL

Purpose:
 CCHKBL tests CGEBAL, a routine for balancing a general complex
 matrix and isolating some of its eigenvalues.
Parameters
[in]NIN
          NIN is INTEGER
          The logical unit number for input.  NIN > 0.
[in]NOUT
          NOUT is INTEGER
          The logical unit number for output.  NOUT > 0.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 53 of file cchkbl.f.

54 *
55 * -- LAPACK test routine --
56 * -- LAPACK is a software package provided by Univ. of Tennessee, --
57 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
58 *
59 * .. Scalar Arguments ..
60  INTEGER NIN, NOUT
61 * ..
62 *
63 * ======================================================================
64 *
65 * .. Parameters ..
66  INTEGER LDA
67  parameter( lda = 20 )
68  REAL ZERO
69  parameter( zero = 0.0e+0 )
70 * ..
71 * .. Local Scalars ..
72  INTEGER I, IHI, IHIIN, ILO, ILOIN, INFO, J, KNT, N,
73  $ NINFO
74  REAL ANORM, MEPS, RMAX, SFMIN, TEMP, VMAX
75  COMPLEX CDUM
76 * ..
77 * .. Local Arrays ..
78  INTEGER LMAX( 3 )
79  REAL DUMMY( 1 ), SCALE( LDA ), SCALIN( LDA )
80  COMPLEX A( LDA, LDA ), AIN( LDA, LDA )
81 * ..
82 * .. External Functions ..
83  REAL CLANGE, SLAMCH
84  EXTERNAL clange, slamch
85 * ..
86 * .. External Subroutines ..
87  EXTERNAL cgebal
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  lmax( 3 ) = 0
103  ninfo = 0
104  knt = 0
105  rmax = zero
106  vmax = zero
107  sfmin = slamch( 'S' )
108  meps = slamch( 'E' )
109 *
110  10 CONTINUE
111 *
112  READ( nin, fmt = * )n
113  IF( n.EQ.0 )
114  $ GO TO 70
115  DO 20 i = 1, n
116  READ( nin, fmt = * )( a( i, j ), j = 1, n )
117  20 CONTINUE
118 *
119  READ( nin, fmt = * )iloin, ihiin
120  DO 30 i = 1, n
121  READ( nin, fmt = * )( ain( i, j ), j = 1, n )
122  30 CONTINUE
123  READ( nin, fmt = * )( scalin( i ), i = 1, n )
124 *
125  anorm = clange( 'M', n, n, a, lda, dummy )
126  knt = knt + 1
127  CALL cgebal( 'B', n, a, lda, ilo, ihi, scale, info )
128 *
129  IF( info.NE.0 ) THEN
130  ninfo = ninfo + 1
131  lmax( 1 ) = knt
132  END IF
133 *
134  IF( ilo.NE.iloin .OR. ihi.NE.ihiin ) THEN
135  ninfo = ninfo + 1
136  lmax( 2 ) = knt
137  END IF
138 *
139  DO 50 i = 1, n
140  DO 40 j = 1, n
141  temp = max( cabs1( a( i, j ) ), cabs1( ain( i, j ) ) )
142  temp = max( temp, sfmin )
143  vmax = max( vmax, cabs1( a( i, j )-ain( i, j ) ) / temp )
144  40 CONTINUE
145  50 CONTINUE
146 *
147  DO 60 i = 1, n
148  temp = max( scale( i ), scalin( i ) )
149  temp = max( temp, sfmin )
150  vmax = max( vmax, abs( scale( i )-scalin( i ) ) / temp )
151  60 CONTINUE
152 *
153  IF( vmax.GT.rmax ) THEN
154  lmax( 3 ) = knt
155  rmax = vmax
156  END IF
157 *
158  GO TO 10
159 *
160  70 CONTINUE
161 *
162  WRITE( nout, fmt = 9999 )
163  9999 FORMAT( 1x, '.. test output of CGEBAL .. ' )
164 *
165  WRITE( nout, fmt = 9998 )rmax
166  9998 FORMAT( 1x, 'value of largest test error = ', e12.3 )
167  WRITE( nout, fmt = 9997 )lmax( 1 )
168  9997 FORMAT( 1x, 'example number where info is not zero = ', i4 )
169  WRITE( nout, fmt = 9996 )lmax( 2 )
170  9996 FORMAT( 1x, 'example number where ILO or IHI wrong = ', i4 )
171  WRITE( nout, fmt = 9995 )lmax( 3 )
172  9995 FORMAT( 1x, 'example number having largest error = ', i4 )
173  WRITE( nout, fmt = 9994 )ninfo
174  9994 FORMAT( 1x, 'number of examples where info is not 0 = ', i4 )
175  WRITE( nout, fmt = 9993 )knt
176  9993 FORMAT( 1x, 'total number of examples tested = ', i4 )
177 *
178  RETURN
179 *
180 * End of CCHKBL
181 *
real function clange(NORM, M, N, A, LDA, WORK)
CLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: clange.f:115
subroutine cgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
CGEBAL
Definition: cgebal.f:161
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:68
Here is the call graph for this function:
Here is the caller graph for this function: