152
153
154
155
156
157
158 LOGICAL TSTERR
159 INTEGER NMAX, NN, NOUT, NRHS
160 REAL THRESH
161
162
163 LOGICAL DOTYPE( * )
164 INTEGER IWORK( * ), NVAL( * )
165 REAL RWORK( * )
166 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
167 $ WORK( * ), X( * ), XACT( * )
168
169
170
171
172
173 REAL ONE, ZERO
174 parameter( one = 1.0e+0, zero = 0.0e+0 )
175 INTEGER NTYPES, NTESTS
176 parameter( ntypes = 11, ntests = 3 )
177 INTEGER NFACT
178 parameter( nfact = 2 )
179
180
181 LOGICAL ZEROT
182 CHARACTER DIST, FACT, TYPE, UPLO, XTYPE
183 CHARACTER*3 MATPATH, PATH
184 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
185 $ IZERO, J, K, KL, KU, LDA, LWORK, MODE, N,
186 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT
187 REAL AINVNM, ANORM, CNDNUM, RCONDC
188
189
190 CHARACTER FACTS( NFACT ), UPLOS( 2 )
191 INTEGER ISEED( 4 ), ISEEDY( 4 )
192 REAL RESULT( NTESTS )
193
194
195
196 REAL CLANSY
198
199
204
205
206 LOGICAL LERR, OK
207 CHARACTER*32 SRNAMT
208 INTEGER INFOT, NUNIT
209
210
211 COMMON / infoc / infot, nunit, ok, lerr
212 COMMON / srnamc / srnamt
213
214
215 INTRINSIC max, min
216
217
218 DATA iseedy / 1988, 1989, 1990, 1991 /
219 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
220
221
222
223
224
225
226
227 path( 1: 1 ) = 'Complex precision'
228 path( 2: 3 ) = 'SR'
229
230
231
232 matpath( 1: 1 ) = 'Complex precision'
233 matpath( 2: 3 ) = 'SY'
234
235 nrun = 0
236 nfail = 0
237 nerrs = 0
238 DO 10 i = 1, 4
239 iseed( i ) = iseedy( i )
240 10 CONTINUE
241 lwork = max( 2*nmax, nmax*nrhs )
242
243
244
245 IF( tsterr )
246 $
CALL cerrvx( path, nout )
247 infot = 0
248
249
250
251
252 nb = 1
253 nbmin = 2
256
257
258
259 DO 180 in = 1, nn
260 n = nval( in )
261 lda = max( n, 1 )
262 xtype = 'N'
263 nimat = ntypes
264 IF( n.LE.0 )
265 $ nimat = 1
266
267 DO 170 imat = 1, nimat
268
269
270
271 IF( .NOT.dotype( imat ) )
272 $ GO TO 170
273
274
275
276 zerot = imat.GE.3 .AND. imat.LE.6
277 IF( zerot .AND. n.LT.imat-2 )
278 $ GO TO 170
279
280
281
282 DO 160 iuplo = 1, 2
283 uplo = uplos( iuplo )
284
285 IF( imat.NE.ntypes ) THEN
286
287
288
289
290
291
292 CALL clatb4( matpath, imat, n, n,
TYPE, KL, KU, ANORM,
293 $ MODE, CNDNUM, DIST )
294
295
296
297 srnamt = 'CLATMS'
298 CALL clatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
299 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA,
300 $ WORK, INFO )
301
302
303
304 IF( info.NE.0 ) THEN
305 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n,
306 $ -1, -1, -1, imat, nfail, nerrs, nout )
307 GO TO 160
308 END IF
309
310
311
312
313 IF( zerot ) THEN
314 IF( imat.EQ.3 ) THEN
315 izero = 1
316 ELSE IF( imat.EQ.4 ) THEN
317 izero = n
318 ELSE
319 izero = n / 2 + 1
320 END IF
321
322 IF( imat.LT.6 ) THEN
323
324
325
326 IF( iuplo.EQ.1 ) THEN
327 ioff = ( izero-1 )*lda
328 DO 20 i = 1, izero - 1
329 a( ioff+i ) = zero
330 20 CONTINUE
331 ioff = ioff + izero
332 DO 30 i = izero, n
333 a( ioff ) = zero
334 ioff = ioff + lda
335 30 CONTINUE
336 ELSE
337 ioff = izero
338 DO 40 i = 1, izero - 1
339 a( ioff ) = zero
340 ioff = ioff + lda
341 40 CONTINUE
342 ioff = ioff - izero
343 DO 50 i = izero, n
344 a( ioff+i ) = zero
345 50 CONTINUE
346 END IF
347 ELSE
348 IF( iuplo.EQ.1 ) THEN
349
350
351
352 ioff = 0
353 DO 70 j = 1, n
354 i2 = min( j, izero )
355 DO 60 i = 1, i2
356 a( ioff+i ) = zero
357 60 CONTINUE
358 ioff = ioff + lda
359 70 CONTINUE
360 ELSE
361
362
363
364 ioff = 0
365 DO 90 j = 1, n
366 i1 = max( j, izero )
367 DO 80 i = i1, n
368 a( ioff+i ) = zero
369 80 CONTINUE
370 ioff = ioff + lda
371 90 CONTINUE
372 END IF
373 END IF
374 ELSE
375 izero = 0
376 END IF
377
378
379
380 ELSE
381
382
383
384
385 CALL clatsy( uplo, n, a, lda, iseed )
386 END IF
387
388 DO 150 ifact = 1, nfact
389
390
391
392 fact = facts( ifact )
393
394
395
396
397 IF( zerot ) THEN
398 IF( ifact.EQ.1 )
399 $ GO TO 150
400 rcondc = zero
401
402 ELSE IF( ifact.EQ.1 ) THEN
403
404
405
406 anorm =
clansy(
'1', uplo, n, a, lda, rwork )
407
408
409
410
411 CALL clacpy( uplo, n, n, a, lda, afac, lda )
413 $ lwork, info )
414
415
416
417 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
418 lwork = (n+nb+1)*(nb+3)
420 $ work, info )
421 ainvnm =
clansy(
'1', uplo, n, ainv, lda, rwork )
422
423
424
425 IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
426 rcondc = one
427 ELSE
428 rcondc = ( one / anorm ) / ainvnm
429 END IF
430 END IF
431
432
433
434 srnamt = 'CLARHS'
435 CALL clarhs( matpath, xtype, uplo,
' ', n, n, kl, ku,
436 $ nrhs, a, lda, xact, lda, b, lda, iseed,
437 $ info )
438 xtype = 'C'
439
440
441
442 IF( ifact.EQ.2 ) THEN
443 CALL clacpy( uplo, n, n, a, lda, afac, lda )
444 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
445
446
447
448
449 srnamt = 'CSYSV_ROOK'
450 CALL csysv_rook( uplo, n, nrhs, afac, lda, iwork,
451 $ x, lda, work, lwork, info )
452
453
454
455
456 k = izero
457 IF( k.GT.0 ) THEN
458 100 CONTINUE
459 IF( iwork( k ).LT.0 ) THEN
460 IF( iwork( k ).NE.-k ) THEN
461 k = -iwork( k )
462 GO TO 100
463 END IF
464 ELSE IF( iwork( k ).NE.k ) THEN
465 k = iwork( k )
466 GO TO 100
467 END IF
468 END IF
469
470
471
472 IF( info.NE.k ) THEN
473 CALL alaerh( path,
'CSYSV_ROOK', info, k, uplo,
474 $ n, n, -1, -1, nrhs, imat, nfail,
475 $ nerrs, nout )
476 GO TO 120
477 ELSE IF( info.NE.0 ) THEN
478 GO TO 120
479 END IF
480
481
482
483
485 $ iwork, ainv, lda, rwork,
486 $ result( 1 ) )
487
488
489
490 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
491 CALL csyt02( uplo, n, nrhs, a, lda, x, lda, work,
492 $ lda, rwork, result( 2 ) )
493
494
495
496
497 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
498 $ result( 3 ) )
499 nt = 3
500
501
502
503
504 DO 110 k = 1, nt
505 IF( result( k ).GE.thresh ) THEN
506 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
507 $
CALL aladhd( nout, path )
508 WRITE( nout, fmt = 9999 )'CSYSV_ROOK', uplo,
509 $ n, imat, k, result( k )
510 nfail = nfail + 1
511 END IF
512 110 CONTINUE
513 nrun = nrun + nt
514 120 CONTINUE
515 END IF
516
517 150 CONTINUE
518
519 160 CONTINUE
520 170 CONTINUE
521 180 CONTINUE
522
523
524
525 CALL alasvm( path, nout, nfail, nrun, nerrs )
526
527 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
528 $ ', test ', i2, ', ratio =', g12.5 )
529 RETURN
530
531
532
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine cerrvx(path, nunit)
CERRVX
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine clatsy(uplo, n, x, ldx, iseed)
CLATSY
subroutine cpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPOT05
subroutine csyt01_rook(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
CSYT01_ROOK
subroutine csyt02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CSYT02
subroutine csysv_rook(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
CSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
subroutine csytrf_rook(uplo, n, a, lda, ipiv, work, lwork, info)
CSYTRF_ROOK
subroutine csytri_rook(uplo, n, a, lda, ipiv, work, info)
CSYTRI_ROOK
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
real function clansy(norm, uplo, n, a, lda, work)
CLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.