88 SUBROUTINE csyl01( THRESH, NFAIL, RMAX, NINFO, KNT )
100 INTEGER NFAIL( 3 ), NINFO( 2 )
108 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
110 parameter( zero = 0.0e+0, one = 1.0e+0 )
111 INTEGER MAXM, MAXN, LDSWORK
112 parameter( maxm = 101, maxn = 138, ldswork = 18 )
115 CHARACTER TRANA, TRANB
116 INTEGER I, INFO, IINFO, ISGN, ITRANA, ITRANB, J, KLA,
117 $ KUA, KLB, KUB, M, N
118 REAL ANRM, BNRM, BIGNUM, EPS, RES, RES1,
119 $ SCALE, SCALE3, SMLNUM, TNRM, XNRM
123 COMPLEX DUML( MAXM ), DUMR( MAXN ),
124 $ D( MAX( MAXM, MAXN ) )
125 REAL DUM( MAXN ), VM( 2 )
126 INTEGER ISEED( 4 ), IWORK( MAXM + MAXN + 2 )
129 INTEGER AllocateStatus
130 COMPLEX,
DIMENSION(:,:),
ALLOCATABLE :: A, B, C, CC, X
131 REAL,
DIMENSION(:,:),
ALLOCATABLE :: SWORK
136 EXTERNAL sisnan, slamch, clange
142 INTRINSIC abs, real, max
145 ALLOCATE ( a( maxm, maxm ), stat = allocatestatus )
146 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
147 ALLOCATE ( b( maxn, maxn ), stat = allocatestatus )
148 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
149 ALLOCATE ( c( maxm, maxn ), stat = allocatestatus )
150 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
151 ALLOCATE ( cc( maxm, maxn ), stat = allocatestatus )
152 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
153 ALLOCATE ( x( maxm, maxn ), stat = allocatestatus )
154 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
155 ALLOCATE ( swork( ldswork, 54 ), stat = allocatestatus )
156 IF( allocatestatus /= 0 ) stop
"*** Not enough memory ***"
163 smlnum = slamch(
'S' ) / eps
164 bignum = one / smlnum
197 CALL clatmr( m, m,
'S', iseed,
'N', d,
198 $ 6, one, cone,
'T',
'N',
199 $ duml, 1, one, dumr, 1, one,
200 $
'N', iwork, kla, kua, zero,
201 $ one,
'NO', a, maxm, iwork,
204 a( i, i ) = a( i, i ) * vm( j )
206 anrm = clange(
'M', m, m, a, maxm, dum )
210 CALL clatmr( n, n,
'S', iseed,
'N', d,
211 $ 6, one, cone,
'T',
'N',
212 $ duml, 1, one, dumr, 1, one,
213 $
'N', iwork, klb, kub, zero,
214 $ one,
'NO', b, maxn, iwork,
217 b( i, i ) = b( i, i ) * vm( j )
219 bnrm = clange(
'M', n, n, b, maxn, dum )
220 tnrm = max( anrm, bnrm )
221 CALL clatmr( m, n,
'S', iseed,
'N', d,
222 $ 6, one, cone,
'T',
'N',
223 $ duml, 1, one, dumr, 1, one,
224 $
'N', iwork, m, n, zero, one,
225 $
'NO', c, maxm, iwork, iinfo )
238 CALL clacpy(
'All', m, n, c, maxm, x, maxm)
239 CALL clacpy(
'All', m, n, c, maxm, cc, maxm)
240 CALL ctrsyl( trana, tranb, isgn, m, n,
241 $ a, maxm, b, maxn, x, maxm,
244 $ ninfo( 1 ) = ninfo( 1 ) + 1
245 xnrm = clange(
'M', m, n, x, maxm, dum )
247 IF( xnrm.GT.one .AND. tnrm.GT.one )
THEN
248 IF( xnrm.GT.bignum / tnrm )
THEN
249 rmul = cone / max( xnrm, tnrm )
252 CALL cgemm( trana,
'N', m, n, m, rmul,
253 $ a, maxm, x, maxm, -scale*rmul,
255 CALL cgemm(
'N', tranb, m, n, n,
256 $ real( isgn )*rmul, x, maxm, b,
257 $ maxn, cone, cc, maxm )
258 res1 = clange(
'M', m, n, cc, maxm, dum )
259 res = res1 / max( smlnum, smlnum*xnrm,
260 $ ( ( abs( rmul )*tnrm )*eps )*xnrm )
262 $ nfail( 1 ) = nfail( 1 ) + 1
263 IF( res.GT.rmax( 1 ) )
266 CALL clacpy(
'All', m, n, c, maxm, x, maxm )
267 CALL clacpy(
'All', m, n, c, maxm, cc, maxm )
268 CALL ctrsyl3( trana, tranb, isgn, m, n,
269 $ a, maxm, b, maxn, x, maxm,
270 $ scale3, swork, ldswork, info)
272 $ ninfo( 2 ) = ninfo( 2 ) + 1
273 xnrm = clange(
'M', m, n, x, maxm, dum )
275 IF( xnrm.GT.one .AND. tnrm.GT.one )
THEN
276 IF( xnrm.GT.bignum / tnrm )
THEN
277 rmul = cone / max( xnrm, tnrm )
280 CALL cgemm( trana,
'N', m, n, m, rmul,
281 $ a, maxm, x, maxm, -scale3*rmul,
283 CALL cgemm(
'N', tranb, m, n, n,
284 $ real( isgn )*rmul, x, maxm, b,
285 $ maxn, cone, cc, maxm )
286 res1 = clange(
'M', m, n, cc, maxm, dum )
287 res = res1 / max( smlnum, smlnum*xnrm,
288 $ ( ( abs( rmul )*tnrm )*eps )*xnrm )
291 IF( scale3.EQ.zero .AND. scale.GT.zero .OR.
292 $ iinfo.NE.info )
THEN
293 nfail( 3 ) = nfail( 3 ) + 1
295 IF( res.GT.thresh .OR. sisnan( res ) )
296 $ nfail( 2 ) = nfail( 2 ) + 1
297 IF( res.GT.rmax( 2 ) )
306 DEALLOCATE (a, stat = allocatestatus)
307 DEALLOCATE (b, stat = allocatestatus)
308 DEALLOCATE (c, stat = allocatestatus)
309 DEALLOCATE (cc, stat = allocatestatus)
310 DEALLOCATE (x, stat = allocatestatus)
311 DEALLOCATE (swork, stat = allocatestatus)
subroutine clatmr(m, n, dist, iseed, sym, d, mode, cond, dmax, rsign, grade, dl, model, condl, dr, moder, condr, pivtng, ipivot, kl, ku, sparse, anorm, pack, a, lda, iwork, info)
CLATMR
subroutine csyl01(thresh, nfail, rmax, ninfo, knt)
CSYL01
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine ctrsyl3(trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale, swork, ldswork, info)
CTRSYL3
subroutine ctrsyl(trana, tranb, isgn, m, n, a, lda, b, ldb, c, ldc, scale, info)
CTRSYL