LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zchkgl ( integer  NIN,
integer  NOUT 
)

ZCHKGL

Purpose:
 ZCHKGL tests ZGGBAL, a routine for balancing a matrix pair (A, B).
Parameters
[in]NIN
          NIN is INTEGER
          The logical unit number for input.  NIN > 0.
[in]NOUT
          NOUT is INTEGER
          The logical unit number for output.  NOUT > 0.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 55 of file zchkgl.f.

55 *
56 * -- LAPACK test routine (version 3.4.0) --
57 * -- LAPACK is a software package provided by Univ. of Tennessee, --
58 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
59 * November 2011
60 *
61 * .. Scalar Arguments ..
62  INTEGER nin, nout
63 * ..
64 *
65 * =====================================================================
66 *
67 * .. Parameters ..
68  INTEGER lda, ldb, lwork
69  parameter ( lda = 20, ldb = 20, lwork = 6*lda )
70  DOUBLE PRECISION zero
71  parameter ( zero = 0.0d+0 )
72 * ..
73 * .. Local Scalars ..
74  INTEGER i, ihi, ihiin, ilo, iloin, info, j, knt, n,
75  $ ninfo
76  DOUBLE PRECISION anorm, bnorm, eps, rmax, vmax
77 * ..
78 * .. Local Arrays ..
79  INTEGER lmax( 3 )
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 ),
83  $ bin( ldb, ldb )
84 * ..
85 * .. External Functions ..
86  DOUBLE PRECISION dlamch, zlange
87  EXTERNAL dlamch, zlange
88 * ..
89 * .. External Subroutines ..
90  EXTERNAL zggbal
91 * ..
92 * .. Intrinsic Functions ..
93  INTRINSIC abs, max
94 * ..
95 * .. Executable Statements ..
96 *
97  lmax( 1 ) = 0
98  lmax( 2 ) = 0
99  lmax( 3 ) = 0
100  ninfo = 0
101  knt = 0
102  rmax = zero
103 *
104  eps = dlamch( 'Precision' )
105 *
106  10 CONTINUE
107 *
108  READ( nin, fmt = * )n
109  IF( n.EQ.0 )
110  $ GO TO 90
111  DO 20 i = 1, n
112  READ( nin, fmt = * )( a( i, j ), j = 1, n )
113  20 CONTINUE
114 *
115  DO 30 i = 1, n
116  READ( nin, fmt = * )( b( i, j ), j = 1, n )
117  30 CONTINUE
118 *
119  READ( nin, fmt = * )iloin, ihiin
120  DO 40 i = 1, n
121  READ( nin, fmt = * )( ain( i, j ), j = 1, n )
122  40 CONTINUE
123  DO 50 i = 1, n
124  READ( nin, fmt = * )( bin( i, j ), j = 1, n )
125  50 CONTINUE
126 *
127  READ( nin, fmt = * )( lsclin( i ), i = 1, n )
128  READ( nin, fmt = * )( rsclin( i ), i = 1, n )
129 *
130  anorm = zlange( 'M', n, n, a, lda, work )
131  bnorm = zlange( 'M', n, n, b, ldb, work )
132 *
133  knt = knt + 1
134 *
135  CALL zggbal( 'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
136  $ work, info )
137 *
138  IF( info.NE.0 ) THEN
139  ninfo = ninfo + 1
140  lmax( 1 ) = knt
141  END IF
142 *
143  IF( ilo.NE.iloin .OR. ihi.NE.ihiin ) THEN
144  ninfo = ninfo + 1
145  lmax( 2 ) = knt
146  END IF
147 *
148  vmax = zero
149  DO 70 i = 1, n
150  DO 60 j = 1, n
151  vmax = max( vmax, abs( a( i, j )-ain( i, j ) ) )
152  vmax = max( vmax, abs( b( i, j )-bin( i, j ) ) )
153  60 CONTINUE
154  70 CONTINUE
155 *
156  DO 80 i = 1, n
157  vmax = max( vmax, abs( lscale( i )-lsclin( i ) ) )
158  vmax = max( vmax, abs( rscale( i )-rsclin( i ) ) )
159  80 CONTINUE
160 *
161  vmax = vmax / ( eps*max( anorm, bnorm ) )
162 *
163  IF( vmax.GT.rmax ) THEN
164  lmax( 3 ) = knt
165  rmax = vmax
166  END IF
167 *
168  GO TO 10
169 *
170  90 CONTINUE
171 *
172  WRITE( nout, fmt = 9999 )
173  9999 FORMAT( ' .. test output of ZGGBAL .. ' )
174 *
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 )
187 *
188  RETURN
189 *
190 * End of ZCHKGL
191 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zggbal(JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE, WORK, INFO)
ZGGBAL
Definition: zggbal.f:179
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 ...
Definition: zlange.f:117

Here is the call graph for this function:

Here is the caller graph for this function: