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   A( LDA, LDA ), AIN( LDA, LDA ), B( LDB, LDB ),
 
   78     $                   BIN( LDB, LDB ), LSCALE( LDA ), LSCLIN( LDA ),
 
   79     $                   RSCALE( LDA ), RSCLIN( LDA ), WORK( LWORK )
 
   82      DOUBLE PRECISION   DLAMCH, DLANGE
 
   83      EXTERNAL           dlamch, dlange
 
  100      eps = dlamch( 
'Precision' )
 
  104      READ( nin, fmt = * )n
 
  108         READ( nin, fmt = * )( a( i, j ), j = 1, n )
 
  112         READ( nin, fmt = * )( b( i, j ), j = 1, n )
 
  115      READ( nin, fmt = * )iloin, ihiin
 
  117         READ( nin, fmt = * )( ain( i, j ), j = 1, n )
 
  120         READ( nin, fmt = * )( bin( i, j ), j = 1, n )
 
  123      READ( nin, fmt = * )( lsclin( i ), i = 1, n )
 
  124      READ( nin, fmt = * )( rsclin( i ), i = 1, n )
 
  126      anorm = dlange( 
'M', n, n, a, lda, work )
 
  127      bnorm = dlange( 
'M', n, n, b, ldb, work )
 
  131      CALL dggbal( 
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
 
  139      IF( ilo.NE.iloin .OR. ihi.NE.ihiin ) 
THEN 
  147            vmax = max( vmax, abs( a( i, j )-ain( i, j ) ) )
 
  148            vmax = max( vmax, abs( b( i, j )-bin( i, j ) ) )
 
  153         vmax = max( vmax, abs( lscale( i )-lsclin( i ) ) )
 
  154         vmax = max( vmax, abs( rscale( i )-rsclin( i ) ) )
 
  157      vmax = vmax / ( eps*max( anorm, bnorm ) )
 
  159      IF( vmax.GT.rmax ) 
THEN 
  168      WRITE( nout, fmt = 9999 )
 
  169 9999 
FORMAT( 1x, 
'.. test output of DGGBAL .. ' )
 
  171      WRITE( nout, fmt = 9998 )rmax
 
  172 9998 
FORMAT( 1x, 
'value of largest test error            = ', d12.3 )
 
  173      WRITE( nout, fmt = 9997 )lmax( 1 )
 
  174 9997 
FORMAT( 1x, 
'example number where info is not zero  = ', i4 )
 
  175      WRITE( nout, fmt = 9996 )lmax( 2 )
 
  176 9996 
FORMAT( 1x, 
'example number where ILO or IHI wrong  = ', i4 )
 
  177      WRITE( nout, fmt = 9995 )lmax( 3 )
 
  178 9995 
FORMAT( 1x, 
'example number having largest error    = ', i4 )
 
  179      WRITE( nout, fmt = 9994 )ninfo
 
  180 9994 
FORMAT( 1x, 
'number of examples where info is not 0 = ', i4 )
 
  181      WRITE( nout, fmt = 9993 )knt
 
  182 9993 
FORMAT( 1x, 
'total number of examples tested        = ', i4 )
 
 
subroutine dggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
DGGBAL