70 parameter ( lda = 20 )
72 parameter ( zero = 0.0e+0 )
75 INTEGER i, ihi, ihiin, ilo, iloin, info, j, knt, n,
77 REAL anorm, meps, rmax, sfmin, temp, vmax
82 REAL dummy( 1 ), scale( lda ), scalin( lda )
83 COMPLEX a( lda, lda ), ain( lda, lda )
93 INTRINSIC abs, aimag, max, real
99 cabs1( cdum ) = abs(
REAL( CDUM ) ) + abs( aimag( cdum ) )
115 READ( nin, fmt = * )n
119 READ( nin, fmt = * )( a( i, j ), j = 1, n )
122 READ( nin, fmt = * )iloin, ihiin
124 READ( nin, fmt = * )( ain( i, j ), j = 1, n )
126 READ( nin, fmt = * )( scalin( i ), i = 1, n )
128 anorm =
clange(
'M', n, n, a, lda, dummy )
130 CALL cgebal(
'B', n, a, lda, ilo, ihi, scale, info )
137 IF( ilo.NE.iloin .OR. ihi.NE.ihiin )
THEN
144 temp = max( cabs1( a( i, j ) ), cabs1( ain( i, j ) ) )
145 temp = max( temp, sfmin )
146 vmax = max( vmax, cabs1( a( i, j )-ain( i, j ) ) / temp )
151 temp = max( scale( i ), scalin( i ) )
152 temp = max( temp, sfmin )
153 vmax = max( vmax, abs( scale( i )-scalin( i ) ) / temp )
156 IF( vmax.GT.rmax )
THEN
165 WRITE( nout, fmt = 9999 )
166 9999
FORMAT( 1x,
'.. test output of CGEBAL .. ' )
168 WRITE( nout, fmt = 9998 )rmax
169 9998
FORMAT( 1x,
'value of largest test error = ', e12.3 )
170 WRITE( nout, fmt = 9997 )lmax( 1 )
171 9997
FORMAT( 1x,
'example number where info is not zero = ', i4 )
172 WRITE( nout, fmt = 9996 )lmax( 2 )
173 9996
FORMAT( 1x,
'example number where ILO or IHI wrong = ', i4 )
174 WRITE( nout, fmt = 9995 )lmax( 3 )
175 9995
FORMAT( 1x,
'example number having largest error = ', i4 )
176 WRITE( nout, fmt = 9994 )ninfo
177 9994
FORMAT( 1x,
'number of examples where info is not 0 = ', i4 )
178 WRITE( nout, fmt = 9993 )knt
179 9993
FORMAT( 1x,
'total number of examples tested = ', i4 )
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 ...
subroutine cgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
CGEBAL
real function slamch(CMACH)
SLAMCH