156
157
158
159
160
161
162 LOGICAL TSTERR
163 INTEGER NMAX, NN, NOUT, NRHS
164 DOUBLE PRECISION THRESH
165
166
167 LOGICAL DOTYPE( * )
168 INTEGER IWORK( * ), NVAL( * )
169 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ),
170 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
171
172
173
174
175
176 DOUBLE PRECISION ONE, ZERO
177 parameter( one = 1.0d+0, zero = 0.0d+0 )
178 INTEGER NTYPES, NTESTS
179 parameter( ntypes = 10, ntests = 6 )
180 INTEGER NFACT
181 parameter( nfact = 2 )
182
183
184 LOGICAL ZEROT
185 CHARACTER DIST, EQUED, FACT, TYPE, UPLO, XTYPE
186 CHARACTER*3 PATH
187 INTEGER I, I1, I2, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
188 $ IZERO, J, K, K1, KL, KU, LDA, LWORK, MODE, N,
189 $ NB, NBMIN, NERRS, NFAIL, NIMAT, NRUN, NT,
190 $ N_ERR_BNDS
191 DOUBLE PRECISION AINVNM, ANORM, CNDNUM, RCOND, RCONDC,
192 $ RPVGRW_SVXX
193
194
195 CHARACTER FACTS( NFACT ), UPLOS( 2 )
196 INTEGER ISEED( 4 ), ISEEDY( 4 )
197 DOUBLE PRECISION RESULT( NTESTS ), BERR( NRHS ),
198 $ ERRBNDS_N( NRHS, 3 ), ERRBNDS_C( NRHS, 3 )
199
200
201 DOUBLE PRECISION DGET06, DLANSY
203
204
209
210
211 LOGICAL LERR, OK
212 CHARACTER*32 SRNAMT
213 INTEGER INFOT, NUNIT
214
215
216 COMMON / infoc / infot, nunit, ok, lerr
217 COMMON / srnamc / srnamt
218
219
220 INTRINSIC max, min
221
222
223 DATA iseedy / 1988, 1989, 1990, 1991 /
224 DATA uplos / 'U', 'L' / , facts / 'F', 'N' /
225
226
227
228
229
230 path( 1: 1 ) = 'Double precision'
231 path( 2: 3 ) = 'SY'
232 nrun = 0
233 nfail = 0
234 nerrs = 0
235 DO 10 i = 1, 4
236 iseed( i ) = iseedy( i )
237 10 CONTINUE
238 lwork = max( 2*nmax, nmax*nrhs )
239
240
241
242 IF( tsterr )
243 $
CALL derrvx( path, nout )
244 infot = 0
245
246
247
248 nb = 1
249 nbmin = 2
252
253
254
255 DO 180 in = 1, nn
256 n = nval( in )
257 lda = max( n, 1 )
258 xtype = 'N'
259 nimat = ntypes
260 IF( n.LE.0 )
261 $ nimat = 1
262
263 DO 170 imat = 1, nimat
264
265
266
267 IF( .NOT.dotype( imat ) )
268 $ GO TO 170
269
270
271
272 zerot = imat.GE.3 .AND. imat.LE.6
273 IF( zerot .AND. n.LT.imat-2 )
274 $ GO TO 170
275
276
277
278 DO 160 iuplo = 1, 2
279 uplo = uplos( iuplo )
280
281
282
283
284 CALL dlatb4( path, imat, n, n,
TYPE, KL, KU, ANORM, MODE,
285 $ CNDNUM, DIST )
286
287 srnamt = 'DLATMS'
288 CALL dlatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
289 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
290 $ INFO )
291
292
293
294 IF( info.NE.0 ) THEN
295 CALL alaerh( path,
'DLATMS', info, 0, uplo, n, n, -1,
296 $ -1, -1, imat, nfail, nerrs, nout )
297 GO TO 160
298 END IF
299
300
301
302
303 IF( zerot ) THEN
304 IF( imat.EQ.3 ) THEN
305 izero = 1
306 ELSE IF( imat.EQ.4 ) THEN
307 izero = n
308 ELSE
309 izero = n / 2 + 1
310 END IF
311
312 IF( imat.LT.6 ) THEN
313
314
315
316 IF( iuplo.EQ.1 ) THEN
317 ioff = ( izero-1 )*lda
318 DO 20 i = 1, izero - 1
319 a( ioff+i ) = zero
320 20 CONTINUE
321 ioff = ioff + izero
322 DO 30 i = izero, n
323 a( ioff ) = zero
324 ioff = ioff + lda
325 30 CONTINUE
326 ELSE
327 ioff = izero
328 DO 40 i = 1, izero - 1
329 a( ioff ) = zero
330 ioff = ioff + lda
331 40 CONTINUE
332 ioff = ioff - izero
333 DO 50 i = izero, n
334 a( ioff+i ) = zero
335 50 CONTINUE
336 END IF
337 ELSE
338 ioff = 0
339 IF( iuplo.EQ.1 ) THEN
340
341
342
343 DO 70 j = 1, n
344 i2 = min( j, izero )
345 DO 60 i = 1, i2
346 a( ioff+i ) = zero
347 60 CONTINUE
348 ioff = ioff + lda
349 70 CONTINUE
350 ELSE
351
352
353
354 DO 90 j = 1, n
355 i1 = max( j, izero )
356 DO 80 i = i1, n
357 a( ioff+i ) = zero
358 80 CONTINUE
359 ioff = ioff + lda
360 90 CONTINUE
361 END IF
362 END IF
363 ELSE
364 izero = 0
365 END IF
366
367 DO 150 ifact = 1, nfact
368
369
370
371 fact = facts( ifact )
372
373
374
375
376 IF( zerot ) THEN
377 IF( ifact.EQ.1 )
378 $ GO TO 150
379 rcondc = zero
380
381 ELSE IF( ifact.EQ.1 ) THEN
382
383
384
385 anorm =
dlansy(
'1', uplo, n, a, lda, rwork )
386
387
388
389 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
390 CALL dsytrf( uplo, n, afac, lda, iwork, work,
391 $ lwork, info )
392
393
394
395 CALL dlacpy( uplo, n, n, afac, lda, ainv, lda )
396 lwork = (n+nb+1)*(nb+3)
397 CALL dsytri2( uplo, n, ainv, lda, iwork, work,
398 $ lwork, info )
399 ainvnm =
dlansy(
'1', uplo, n, ainv, lda, rwork )
400
401
402
403 IF( anorm.LE.zero .OR. ainvnm.LE.zero ) THEN
404 rcondc = one
405 ELSE
406 rcondc = ( one / anorm ) / ainvnm
407 END IF
408 END IF
409
410
411
412 srnamt = 'DLARHS'
413 CALL dlarhs( path, xtype, uplo,
' ', n, n, kl, ku,
414 $ nrhs, a, lda, xact, lda, b, lda, iseed,
415 $ info )
416 xtype = 'C'
417
418
419
420 IF( ifact.EQ.2 ) THEN
421 CALL dlacpy( uplo, n, n, a, lda, afac, lda )
422 CALL dlacpy(
'Full', n, nrhs, b, lda, x, lda )
423
424
425
426 srnamt = 'DSYSV '
427 CALL dsysv( uplo, n, nrhs, afac, lda, iwork, x,
428 $ lda, work, lwork, info )
429
430
431
432
433 k = izero
434 IF( k.GT.0 ) THEN
435 100 CONTINUE
436 IF( iwork( k ).LT.0 ) THEN
437 IF( iwork( k ).NE.-k ) THEN
438 k = -iwork( k )
439 GO TO 100
440 END IF
441 ELSE IF( iwork( k ).NE.k ) THEN
442 k = iwork( k )
443 GO TO 100
444 END IF
445 END IF
446
447
448
449 IF( info.NE.k ) THEN
450 CALL alaerh( path,
'DSYSV ', info, k, uplo, n,
451 $ n, -1, -1, nrhs, imat, nfail,
452 $ nerrs, nout )
453 GO TO 120
454 ELSE IF( info.NE.0 ) THEN
455 GO TO 120
456 END IF
457
458
459
460
461 CALL dsyt01( uplo, n, a, lda, afac, lda, iwork,
462 $ ainv, lda, rwork, result( 1 ) )
463
464
465
466 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
467 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
468 $ lda, rwork, result( 2 ) )
469
470
471
472 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
473 $ result( 3 ) )
474 nt = 3
475
476
477
478
479 DO 110 k = 1, nt
480 IF( result( k ).GE.thresh ) THEN
481 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
482 $
CALL aladhd( nout, path )
483 WRITE( nout, fmt = 9999 )'DSYSV ', uplo, n,
484 $ imat, k, result( k )
485 nfail = nfail + 1
486 END IF
487 110 CONTINUE
488 nrun = nrun + nt
489 120 CONTINUE
490 END IF
491
492
493
494 IF( ifact.EQ.2 )
495 $
CALL dlaset( uplo, n, n, zero, zero, afac, lda )
496 CALL dlaset(
'Full', n, nrhs, zero, zero, x, lda )
497
498
499
500
501 srnamt = 'DSYSVX'
502 CALL dsysvx( fact, uplo, n, nrhs, a, lda, afac, lda,
503 $ iwork, b, lda, x, lda, rcond, rwork,
504 $ rwork( nrhs+1 ), work, lwork,
505 $ iwork( n+1 ), info )
506
507
508
509
510 k = izero
511 IF( k.GT.0 ) THEN
512 130 CONTINUE
513 IF( iwork( k ).LT.0 ) THEN
514 IF( iwork( k ).NE.-k ) THEN
515 k = -iwork( k )
516 GO TO 130
517 END IF
518 ELSE IF( iwork( k ).NE.k ) THEN
519 k = iwork( k )
520 GO TO 130
521 END IF
522 END IF
523
524
525
526 IF( info.NE.k ) THEN
527 CALL alaerh( path,
'DSYSVX', info, k, fact // uplo,
528 $ n, n, -1, -1, nrhs, imat, nfail,
529 $ nerrs, nout )
530 GO TO 150
531 END IF
532
533 IF( info.EQ.0 ) THEN
534 IF( ifact.GE.2 ) THEN
535
536
537
538
539 CALL dsyt01( uplo, n, a, lda, afac, lda, iwork,
540 $ ainv, lda, rwork( 2*nrhs+1 ),
541 $ result( 1 ) )
542 k1 = 1
543 ELSE
544 k1 = 2
545 END IF
546
547
548
549 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
550 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
551 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
552
553
554
555 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
556 $ result( 3 ) )
557
558
559
560 CALL dpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
561 $ xact, lda, rwork, rwork( nrhs+1 ),
562 $ result( 4 ) )
563 ELSE
564 k1 = 6
565 END IF
566
567
568
569
570 result( 6 ) =
dget06( rcond, rcondc )
571
572
573
574
575 DO 140 k = k1, 6
576 IF( result( k ).GE.thresh ) THEN
577 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
578 $
CALL aladhd( nout, path )
579 WRITE( nout, fmt = 9998 )'DSYSVX', fact, uplo,
580 $ n, imat, k, result( k )
581 nfail = nfail + 1
582 END IF
583 140 CONTINUE
584 nrun = nrun + 7 - k1
585
586
587
588
589
590 IF( ifact.EQ.2 )
591 $
CALL dlaset( uplo, n, n, zero, zero, afac, lda )
592 CALL dlaset(
'Full', n, nrhs, zero, zero, x, lda )
593
594
595
596
597 srnamt = 'DSYSVXX'
598 n_err_bnds = 3
599 equed = 'N'
600 CALL dsysvxx( fact, uplo, n, nrhs, a, lda, afac,
601 $ lda, iwork, equed, work( n+1 ), b, lda, x,
602 $ lda, rcond, rpvgrw_svxx, berr, n_err_bnds,
603 $ errbnds_n, errbnds_c, 0, zero, work,
604 $ iwork( n+1 ), info )
605
606
607
608
609 k = izero
610 IF( k.GT.0 ) THEN
611 135 CONTINUE
612 IF( iwork( k ).LT.0 ) THEN
613 IF( iwork( k ).NE.-k ) THEN
614 k = -iwork( k )
615 GO TO 135
616 END IF
617 ELSE IF( iwork( k ).NE.k ) THEN
618 k = iwork( k )
619 GO TO 135
620 END IF
621 END IF
622
623
624
625 IF( info.NE.k .AND. info.LE.n ) THEN
626 CALL alaerh( path,
'DSYSVXX', info, k,
627 $ fact // uplo, n, n, -1, -1, nrhs, imat, nfail,
628 $ nerrs, nout )
629 GO TO 150
630 END IF
631
632 IF( info.EQ.0 ) THEN
633 IF( ifact.GE.2 ) THEN
634
635
636
637
638 CALL dsyt01( uplo, n, a, lda, afac, lda, iwork,
639 $ ainv, lda, rwork(2*nrhs+1),
640 $ result( 1 ) )
641 k1 = 1
642 ELSE
643 k1 = 2
644 END IF
645
646
647
648 CALL dlacpy(
'Full', n, nrhs, b, lda, work, lda )
649 CALL dpot02( uplo, n, nrhs, a, lda, x, lda, work,
650 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
651
652
653
654 CALL dget04( n, nrhs, x, lda, xact, lda, rcondc,
655 $ result( 3 ) )
656
657
658
659 CALL dpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
660 $ xact, lda, rwork, rwork( nrhs+1 ),
661 $ result( 4 ) )
662 ELSE
663 k1 = 6
664 END IF
665
666
667
668
669 result( 6 ) =
dget06( rcond, rcondc )
670
671
672
673
674 DO 85 k = k1, 6
675 IF( result( k ).GE.thresh ) THEN
676 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
677 $
CALL aladhd( nout, path )
678 WRITE( nout, fmt = 9998 )'DSYSVXX',
679 $ fact, uplo, n, imat, k,
680 $ result( k )
681 nfail = nfail + 1
682 END IF
683 85 CONTINUE
684 nrun = nrun + 7 - k1
685
686 150 CONTINUE
687
688 160 CONTINUE
689 170 CONTINUE
690 180 CONTINUE
691
692
693
694 CALL alasvm( path, nout, nfail, nrun, nerrs )
695
696
697
698
700
701 9999 FORMAT( 1x, a, ', UPLO=''', a1, ''', N =', i5, ', type ', i2,
702 $ ', test ', i2, ', ratio =', g12.5 )
703 9998 FORMAT( 1x, a, ', FACT=''', a1, ''', UPLO=''', a1, ''', N =', i5,
704 $ ', type ', i2, ', test ', i2, ', ratio =', g12.5 )
705 RETURN
706
707
708
subroutine alasvm(type, nout, nfail, nrun, nerrs)
ALASVM
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 aladhd(iounit, path)
ALADHD
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine debchvxx(thresh, path)
DEBCHVXX
subroutine derrvx(path, nunit)
DERRVX
subroutine dget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
DGET04
double precision function dget06(rcond, rcondc)
DGET06
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 dpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
DPOT05
subroutine dsyt01(uplo, n, a, lda, afac, ldafac, ipiv, c, ldc, rwork, resid)
DSYT01
subroutine dsysv(uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)
DSYSV computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysvx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, iwork, info)
DSYSVX computes the solution to system of linear equations A * X = B for SY matrices
subroutine dsysvxx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)
DSYSVXX
subroutine dsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
DSYTRF
subroutine dsytri2(uplo, n, a, lda, ipiv, work, lwork, info)
DSYTRI2
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
double precision function dlansy(norm, uplo, n, a, lda, work)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.