170
171
172
173
174
175 IMPLICIT NONE
176
177
178 LOGICAL TSTERR
179 INTEGER NN, NNB, NNS, NMAX, NOUT
180 DOUBLE PRECISION THRESH
181
182
183 LOGICAL DOTYPE( * )
184 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
185 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ),
186 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
187
188
189
190
191
192 DOUBLE PRECISION ZERO, ONE
193 parameter( zero = 0.0d+0, one = 1.0d+0 )
194 INTEGER NTYPES
195 parameter( ntypes = 10 )
196 INTEGER NTESTS
197 parameter( ntests = 9 )
198
199
200 LOGICAL ZEROT
201 CHARACTER DIST, TYPE, UPLO, XTYPE
202 CHARACTER*3 PATH, MATPATH
203 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
204 $ IUPLO, IZERO, J, K, KL, KU, LDA, LWORK, MODE,
205 $ N, NB, NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
206 DOUBLE PRECISION ANORM, CNDNUM
207
208
209 CHARACTER UPLOS( 2 )
210 INTEGER ISEED( 4 ), ISEEDY( 4 )
211 DOUBLE PRECISION RESULT( NTESTS )
212
213
217
218
219 INTRINSIC max, min
220
221
222 LOGICAL LERR, OK
223 CHARACTER*32 SRNAMT
224 INTEGER INFOT, NUNIT
225
226
227 COMMON / infoc / infot, nunit, ok, lerr
228 COMMON / srnamc / srnamt
229
230
231 DATA iseedy / 1988, 1989, 1990, 1991 /
232 DATA uplos / 'U', 'L' /
233
234
235
236
237
238
239
240 path( 1: 1 ) = 'Double precision'
241 path( 2: 3 ) = 'SA'
242
243
244
245 matpath( 1: 1 ) = 'Double precision'
246 matpath( 2: 3 ) = 'SY'
247 nrun = 0
248 nfail = 0
249 nerrs = 0
250 DO 10 i = 1, 4
251 iseed( i ) = iseedy( i )
252 10 CONTINUE
253
254
255
256 IF( tsterr )
257 $
CALL derrsy( path, nout )
258 infot = 0
259
260
261
262
264
265
266
267 DO 180 in = 1, nn
268 n = nval( in )
269 IF( n .GT. nmax ) THEN
270 nfail = nfail + 1
271 WRITE(nout, 9995) 'M ', n, nmax
272 GO TO 180
273 END IF
274 lda = max( n, 1 )
275 xtype = 'N'
276 nimat = ntypes
277 IF( n.LE.0 )
278 $ nimat = 1
279
280 izero = 0
281
282
283
284 DO 170 imat = 1, nimat
285
286
287
288 IF( .NOT.dotype( imat ) )
289 $ GO TO 170
290
291
292
293 zerot = imat.GE.3 .AND. imat.LE.6
294 IF( zerot .AND. n.LT.imat-2 )
295 $ GO TO 170
296
297
298
299 DO 160 iuplo = 1, 2
300 uplo = uplos( iuplo )
301
302
303
304
305
306
307
308 CALL dlatb4( matpath, imat, n, n,
TYPE, KL, KU,
309 $ ANORM, MODE, CNDNUM, DIST )
310
311
312
313 srnamt = 'DLATMS'
314 CALL dlatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
315 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
316 $ INFO )
317
318
319
320 IF( info.NE.0 ) THEN
321 CALL alaerh( path,
'DLATMS', info, 0, uplo, n, n, -1,
322 $ -1, -1, imat, nfail, nerrs, nout )
323
324
325
326 GO TO 160
327 END IF
328
329
330
331
332
333 IF( zerot ) THEN
334 IF( imat.EQ.3 ) THEN
335 izero = 1
336 ELSE IF( imat.EQ.4 ) THEN
337 izero = n
338 ELSE
339 izero = n / 2 + 1
340 END IF
341
342 IF( imat.LT.6 ) THEN
343
344
345
346 IF( iuplo.EQ.1 ) THEN
347 ioff = ( izero-1 )*lda
348 DO 20 i = 1, izero - 1
349 a( ioff+i ) = zero
350 20 CONTINUE
351 ioff = ioff + izero
352 DO 30 i = izero, n
353 a( ioff ) = zero
354 ioff = ioff + lda
355 30 CONTINUE
356 ELSE
357 ioff = izero
358 DO 40 i = 1, izero - 1
359 a( ioff ) = zero
360 ioff = ioff + lda
361 40 CONTINUE
362 ioff = ioff - izero
363 DO 50 i = izero, n
364 a( ioff+i ) = zero
365 50 CONTINUE
366 END IF
367 ELSE
368 IF( iuplo.EQ.1 ) THEN
369
370
371
372 ioff = 0
373 DO 70 j = 1, n
374 i2 = min( j, izero )
375 DO 60 i = 1, i2
376 a( ioff+i ) = zero
377 60 CONTINUE
378 ioff = ioff + lda
379 70 CONTINUE
380 izero = 1
381 ELSE
382
383
384
385 ioff = 0
386 DO 90 j = 1, n
387 i1 = max( j, izero )
388 DO 80 i = i1, n
389 a( ioff+i ) = zero
390 80 CONTINUE
391 ioff = ioff + lda
392 90 CONTINUE
393 END IF
394 END IF
395 ELSE
396 izero = 0
397 END IF
398
399
400
401
402
403 DO 150 inb = 1, nnb
404
405
406
407
408 nb = nbval( inb )
410
411
412
413
414
415 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
416
417
418
419
420
421
422 srnamt = 'DSYTRF_AA'
423 lwork = max( 1, n*nb + n )
424 CALL dsytrf_aa( uplo, n, afac, lda, iwork, ainv,
425 $ lwork, info )
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444 k = 0
445
446
447
448
449 IF( info.NE.k ) THEN
450 CALL alaerh( path,
'DSYTRF_AA', info, k, uplo,
451 $ n, n, -1, -1, nb, imat, nfail, nerrs,
452 $ nout )
453 END IF
454
455
456
457
458 CALL dsyt01_aa( uplo, n, a, lda, afac, lda, iwork,
459 $ ainv, lda, rwork, result( 1 ) )
460 nt = 1
461
462
463
464
465
466 DO 110 k = 1, nt
467 IF( result( k ).GE.thresh ) THEN
468 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
469 $
CALL alahd( nout, path )
470 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
471 $ result( k )
472 nfail = nfail + 1
473 END IF
474 110 CONTINUE
475 nrun = nrun + nt
476
477
478
479 IF( info.NE.0 ) THEN
480 GO TO 140
481 END IF
482
483
484
485 DO 130 irhs = 1, nns
486 nrhs = nsval( irhs )
487
488
489
490
491
492
493
494 srnamt = 'DLARHS'
495 CALL dlarhs( matpath, xtype, uplo,
' ', n, n,
496 $ kl, ku, nrhs, a, lda, xact, lda,
497 $ b, lda, iseed, info )
498 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
499
500 srnamt = 'DSYTRS_AA'
501 lwork = max( 1, 3*n-2 )
502 CALL dsytrs_aa( uplo, n, nrhs, afac, lda,
503 $ iwork, x, lda, work, lwork,
504 $ info )
505
506
507
508 IF( info.NE.0 ) THEN
509 IF( izero.EQ.0 ) THEN
510 CALL alaerh( path,
'DSYTRS_AA', info, 0,
511 $ uplo, n, n, -1, -1, nrhs, imat,
512 $ nfail, nerrs, nout )
513 END IF
514 ELSE
515 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda
516 $ )
517
518
519
520 CALL dpot02( uplo, n, nrhs, a, lda, x, lda,
521 $ work, lda, rwork, result( 2 ) )
522
523
524
525
526
527 DO 120 k = 2, 2
528 IF( result( k ).GE.thresh ) THEN
529 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
530 $
CALL alahd( nout, path )
531 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
532 $ imat, k, result( k )
533 nfail = nfail + 1
534 END IF
535 120 CONTINUE
536 END IF
537 nrun = nrun + 1
538
539
540
541 130 CONTINUE
542 140 CONTINUE
543 150 CONTINUE
544 160 CONTINUE
545 170 CONTINUE
546 180 CONTINUE
547
548
549
550 CALL alasum( path, nout, nfail, nrun, nerrs )
551
552 9999 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NB =', i4, ', type ',
553 $ i2, ', test ', i2, ', ratio =', g12.5 )
554 9998 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NRHS=', i3, ', type ',
555 $ i2, ', test(', i2, ') =', g12.5 )
556 9995 FORMAT( ' Invalid input value: ', a4, '=', i6, '; must be <=',
557 $ i6 )
558 RETURN
559
560
561
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine dlarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
DLARHS
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine derrsy(path, nunit)
DERRSY
subroutine dlatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
DLATB4
subroutine dlatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
DLATMS
subroutine dpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
DPOT02
subroutine dsyt01_aa(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
DSYT01
subroutine dsytrf_aa(uplo, n, a, lda, ipiv, work, lwork, info)
DSYTRF_AA
subroutine dsytrs_aa(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
DSYTRS_AA
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.