54 SUBROUTINE cchkgl( NIN, NOUT )
68 INTEGER LDA, LDB, LWORK
69 parameter ( lda = 20, ldb = 20, lwork = 6*lda )
71 parameter ( zero = 0.0e+0 )
74 INTEGER I, IHI, IHIIN, ILO, ILOIN, INFO, J, KNT, N,
76 REAL ANORM, BNORM, EPS, RMAX, VMAX
80 REAL LSCALE( lda ), LSCLIN( lda ), RSCALE( lda ),
81 $ rsclin( lda ), work( lwork )
82 COMPLEX A( lda, lda ), AIN( lda, lda ), B( ldb, ldb ),
87 EXTERNAL clange, slamch
104 eps = slamch(
'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 = clange(
'M', n, n, a, lda, work )
131 bnorm = clange(
'M', n, n, b, ldb, work )
135 CALL cggbal(
'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 CGGBAL .. ' )
175 WRITE( nout, fmt = 9998 )rmax
176 9998
FORMAT(
' ratio of largest test error = ', e12.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 )
subroutine cggbal(JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE, WORK, INFO)
CGGBAL
subroutine cchkgl(NIN, NOUT)
CCHKGL