68 INTEGER lda, ldb, lwork
69 parameter ( lda = 20, ldb = 20, lwork = 6*lda )
71 parameter ( zero = 0.0d+0 )
74 INTEGER i, ihi, ihiin, ilo, iloin, info, j, knt, n,
76 DOUBLE PRECISION anorm, bnorm, eps, rmax, vmax
80 DOUBLE PRECISION lscale( lda ), lsclin( lda ), rscale( lda ),
81 $ rsclin( lda ), work( lwork )
82 COMPLEX*16 a( lda, lda ), ain( lda, lda ), b( ldb, ldb ),
104 eps =
dlamch(
'Precision' )
108 READ( nin, fmt = * )n
112 READ( nin, fmt = * )( a( i, j ), j = 1, n )
116 READ( nin, fmt = * )( b( i, j ), j = 1, n )
119 READ( nin, fmt = * )iloin, ihiin
121 READ( nin, fmt = * )( ain( i, j ), j = 1, n )
124 READ( nin, fmt = * )( bin( i, j ), j = 1, n )
127 READ( nin, fmt = * )( lsclin( i ), i = 1, n )
128 READ( nin, fmt = * )( rsclin( i ), i = 1, n )
130 anorm =
zlange(
'M', n, n, a, lda, work )
131 bnorm =
zlange(
'M', n, n, b, ldb, work )
135 CALL zggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
143 IF( ilo.NE.iloin .OR. ihi.NE.ihiin )
THEN
151 vmax = max( vmax, abs( a( i, j )-ain( i, j ) ) )
152 vmax = max( vmax, abs( b( i, j )-bin( i, j ) ) )
157 vmax = max( vmax, abs( lscale( i )-lsclin( i ) ) )
158 vmax = max( vmax, abs( rscale( i )-rsclin( i ) ) )
161 vmax = vmax / ( eps*max( anorm, bnorm ) )
163 IF( vmax.GT.rmax )
THEN
172 WRITE( nout, fmt = 9999 )
173 9999
FORMAT(
' .. test output of ZGGBAL .. ' )
175 WRITE( nout, fmt = 9998 )rmax
176 9998
FORMAT(
' ratio of largest test error = ', d12.3 )
177 WRITE( nout, fmt = 9997 )lmax( 1 )
178 9997
FORMAT(
' example number where info is not zero = ', i4 )
179 WRITE( nout, fmt = 9996 )lmax( 2 )
180 9996
FORMAT(
' example number where ILO or IHI is wrong = ', i4 )
181 WRITE( nout, fmt = 9995 )lmax( 3 )
182 9995
FORMAT(
' example number having largest error = ', i4 )
183 WRITE( nout, fmt = 9994 )ninfo
184 9994
FORMAT(
' number of examples where info is not 0 = ', i4 )
185 WRITE( nout, fmt = 9993 )knt
186 9993
FORMAT(
' total number of examples tested = ', i4 )
double precision function dlamch(CMACH)
DLAMCH
subroutine zggbal(JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE, WORK, INFO)
ZGGBAL
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...