55 SUBROUTINE zchkbl( NIN, NOUT )
70 parameter ( lda = 20 )
72 parameter ( zero = 0.0d+0 )
75 INTEGER I, IHI, IHIIN, ILO, ILOIN, INFO, J, KNT, N,
77 DOUBLE PRECISION ANORM, MEPS, RMAX, SFMIN, TEMP, VMAX
82 DOUBLE PRECISION DUMMY( 1 ), SCALE( lda ), SCALIN( lda )
83 COMPLEX*16 A( lda, lda ), AIN( lda, lda )
86 DOUBLE PRECISION DLAMCH, ZLANGE
87 EXTERNAL dlamch, zlange
93 INTRINSIC abs, dble, dimag, max
96 DOUBLE PRECISION CABS1
99 cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
110 sfmin = dlamch(
'S' )
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 = zlange(
'M', n, n, a, lda, dummy )
130 CALL zgebal(
'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 ZGEBAL .. ' )
168 WRITE( nout, fmt = 9998 )rmax
169 9998
FORMAT( 1x,
'value of largest test error = ', d12.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 )
subroutine zchkbl(NIN, NOUT)
ZCHKBL
subroutine zgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
ZGEBAL