65 INTEGER LDA, LDB, LWORK
66 parameter( lda = 20, ldb = 20, lwork = 6*lda )
68 parameter( zero = 0.0d+0 )
71 INTEGER I, IHI, IHIIN, ILO, ILOIN, INFO, J, KNT, N,
73 DOUBLE PRECISION ANORM, BNORM, EPS, RMAX, VMAX
77 DOUBLE PRECISION LSCALE( LDA ), LSCLIN( LDA ), RSCALE( LDA ),
78 $ RSCLIN( LDA ), WORK( LWORK )
79 COMPLEX*16 A( LDA, LDA ), AIN( LDA, LDA ), B( LDB, LDB ),
83 DOUBLE PRECISION DLAMCH, ZLANGE
84 EXTERNAL dlamch, zlange
101 eps = dlamch(
'Precision' )
105 READ( nin, fmt = * )n
109 READ( nin, fmt = * )( a( i, j ), j = 1, n )
113 READ( nin, fmt = * )( b( i, j ), j = 1, n )
116 READ( nin, fmt = * )iloin, ihiin
118 READ( nin, fmt = * )( ain( i, j ), j = 1, n )
121 READ( nin, fmt = * )( bin( i, j ), j = 1, n )
124 READ( nin, fmt = * )( lsclin( i ), i = 1, n )
125 READ( nin, fmt = * )( rsclin( i ), i = 1, n )
127 anorm = zlange(
'M', n, n, a, lda, work )
128 bnorm = zlange(
'M', n, n, b, ldb, work )
132 CALL zggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
140 IF( ilo.NE.iloin .OR. ihi.NE.ihiin )
THEN
148 vmax = max( vmax, abs( a( i, j )-ain( i, j ) ) )
149 vmax = max( vmax, abs( b( i, j )-bin( i, j ) ) )
154 vmax = max( vmax, abs( lscale( i )-lsclin( i ) ) )
155 vmax = max( vmax, abs( rscale( i )-rsclin( i ) ) )
158 vmax = vmax / ( eps*max( anorm, bnorm ) )
160 IF( vmax.GT.rmax )
THEN
169 WRITE( nout, fmt = 9999 )
170 9999
FORMAT(
' .. test output of ZGGBAL .. ' )
172 WRITE( nout, fmt = 9998 )rmax
173 9998
FORMAT(
' ratio of largest test error = ', d12.3 )
174 WRITE( nout, fmt = 9997 )lmax( 1 )
175 9997
FORMAT(
' example number where info is not zero = ', i4 )
176 WRITE( nout, fmt = 9996 )lmax( 2 )
177 9996
FORMAT(
' example number where ILO or IHI is wrong = ', i4 )
178 WRITE( nout, fmt = 9995 )lmax( 3 )
179 9995
FORMAT(
' example number having largest error = ', i4 )
180 WRITE( nout, fmt = 9994 )ninfo
181 9994
FORMAT(
' number of examples where info is not 0 = ', i4 )
182 WRITE( nout, fmt = 9993 )knt
183 9993
FORMAT(
' total number of examples tested = ', i4 )
subroutine zggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
ZGGBAL
subroutine zchkgl(nin, nout)
ZCHKGL