460
461
462
463
464
465
466
467
468
469
470 DOUBLE PRECISION ZERO, HALF
471 parameter( zero = 0.0d0, half = 0.5d0 )
472
473 DOUBLE PRECISION EPS, THRESH
474 INTEGER INCMAX, NALF, NBET, NIDIM, NINC, NKB, NMAX,
475 $ NOUT, NTRA, IORDER
476 LOGICAL FATAL, REWI, TRACE
477 CHARACTER*12 SNAME
478
479 DOUBLE PRECISION A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
480 $ AS( NMAX*NMAX ), BET( NBET ), G( NMAX ),
481 $ X( NMAX ), XS( NMAX*INCMAX ),
482 $ XX( NMAX*INCMAX ), Y( NMAX ),
483 $ YS( NMAX*INCMAX ), YT( NMAX ),
484 $ YY( NMAX*INCMAX )
485 INTEGER IDIM( NIDIM ), INC( NINC ), KB( NKB )
486
487 DOUBLE PRECISION ALPHA, ALS, BETA, BLS, ERR, ERRMAX, TRANSL
488 INTEGER I, IA, IB, IC, IKU, IM, IN, INCX, INCXS, INCY,
489 $ INCYS, IX, IY, KL, KLS, KU, KUS, LAA, LDA,
490 $ LDAS, LX, LY, M, ML, MS, N, NARGS, NC, ND, NK,
491 $ NL, NS
492 LOGICAL BANDED, FULL, NULL, RESET, SAME, TRAN
493 CHARACTER*1 TRANS, TRANSS
494 CHARACTER*14 CTRANS
495 CHARACTER*3 ICH
496
497 LOGICAL ISAME( 13 )
498
499 LOGICAL LDE, LDERES
501
503
504 INTRINSIC abs, max, min
505
506 INTEGER INFOT, NOUTC
507 LOGICAL OK
508
509 COMMON /infoc/infot, noutc, ok
510
511 DATA ich/'NTC'/
512
513 full = sname( 9: 9 ).EQ.'e'
514 banded = sname( 9: 9 ).EQ.'b'
515
516 IF( full )THEN
517 nargs = 11
518 ELSE IF( banded )THEN
519 nargs = 13
520 END IF
521
522 nc = 0
523 reset = .true.
524 errmax = zero
525
526 DO 120 in = 1, nidim
527 n = idim( in )
528 nd = n/2 + 1
529
530 DO 110 im = 1, 2
531 IF( im.EQ.1 )
532 $ m = max( n - nd, 0 )
533 IF( im.EQ.2 )
534 $ m = min( n + nd, nmax )
535
536 IF( banded )THEN
537 nk = nkb
538 ELSE
539 nk = 1
540 END IF
541 DO 100 iku = 1, nk
542 IF( banded )THEN
543 ku = kb( iku )
544 kl = max( ku - 1, 0 )
545 ELSE
546 ku = n - 1
547 kl = m - 1
548 END IF
549
550 IF( banded )THEN
551 lda = kl + ku + 1
552 ELSE
553 lda = m
554 END IF
555 IF( lda.LT.nmax )
556 $ lda = lda + 1
557
558 IF( lda.GT.nmax )
559 $ GO TO 100
560 laa = lda*n
561 null = n.LE.0.OR.m.LE.0
562
563
564
565 transl = zero
566 CALL dmake( sname( 8: 9 ),
' ',
' ', m, n, a, nmax, aa,
567 $ lda, kl, ku, reset, transl )
568
569 DO 90 ic = 1, 3
570 trans = ich( ic: ic )
571 IF (trans.EQ.'N')THEN
572 ctrans = ' CblasNoTrans'
573 ELSE IF (trans.EQ.'T')THEN
574 ctrans = ' CblasTrans'
575 ELSE
576 ctrans = 'CblasConjTrans'
577 END IF
578 tran = trans.EQ.'T'.OR.trans.EQ.'C'
579
580 IF( tran )THEN
581 ml = n
582 nl = m
583 ELSE
584 ml = m
585 nl = n
586 END IF
587
588 DO 80 ix = 1, ninc
589 incx = inc( ix )
590 lx = abs( incx )*nl
591
592
593
594 transl = half
595 CALL dmake(
'ge',
' ',
' ', 1, nl, x, 1, xx,
596 $ abs( incx ), 0, nl - 1, reset, transl )
597 IF( nl.GT.1 )THEN
598 x( nl/2 ) = zero
599 xx( 1 + abs( incx )*( nl/2 - 1 ) ) = zero
600 END IF
601
602 DO 70 iy = 1, ninc
603 incy = inc( iy )
604 ly = abs( incy )*ml
605
606 DO 60 ia = 1, nalf
607 alpha = alf( ia )
608
609 DO 50 ib = 1, nbet
610 beta = bet( ib )
611
612
613
614 transl = zero
615 CALL dmake(
'ge',
' ',
' ', 1, ml, y, 1,
616 $ yy, abs( incy ), 0, ml - 1,
617 $ reset, transl )
618
619 nc = nc + 1
620
621
622
623
624 transs = trans
625 ms = m
626 ns = n
627 kls = kl
628 kus = ku
629 als = alpha
630 DO 10 i = 1, laa
631 as( i ) = aa( i )
632 10 CONTINUE
633 ldas = lda
634 DO 20 i = 1, lx
635 xs( i ) = xx( i )
636 20 CONTINUE
637 incxs = incx
638 bls = beta
639 DO 30 i = 1, ly
640 ys( i ) = yy( i )
641 30 CONTINUE
642 incys = incy
643
644
645
646 IF( full )THEN
647 IF( trace )
648 $ WRITE( ntra, fmt = 9994 )nc, sname,
649 $ ctrans, m, n, alpha, lda, incx,
650 $ beta, incy
651 IF( rewi )
652 $ rewind ntra
653 CALL cdgemv( iorder, trans, m, n,
654 $ alpha, aa, lda, xx, incx,
655 $ beta, yy, incy )
656 ELSE IF( banded )THEN
657 IF( trace )
658 $ WRITE( ntra, fmt = 9995 )nc, sname,
659 $ ctrans, m, n, kl, ku, alpha, lda,
660 $ incx, beta, incy
661 IF( rewi )
662 $ rewind ntra
663 CALL cdgbmv( iorder, trans, m, n, kl,
664 $ ku, alpha, aa, lda, xx,
665 $ incx, beta, yy, incy )
666 END IF
667
668
669
670 IF( .NOT.ok )THEN
671 WRITE( nout, fmt = 9993 )
672 fatal = .true.
673 GO TO 130
674 END IF
675
676
677
678 isame( 1 ) = trans.EQ.transs
679 isame( 2 ) = ms.EQ.m
680 isame( 3 ) = ns.EQ.n
681 IF( full )THEN
682 isame( 4 ) = als.EQ.alpha
683 isame( 5 ) =
lde( as, aa, laa )
684 isame( 6 ) = ldas.EQ.lda
685 isame( 7 ) =
lde( xs, xx, lx )
686 isame( 8 ) = incxs.EQ.incx
687 isame( 9 ) = bls.EQ.beta
688 IF( null )THEN
689 isame( 10 ) =
lde( ys, yy, ly )
690 ELSE
691 isame( 10 ) =
lderes(
'ge',
' ', 1,
692 $ ml, ys, yy,
693 $ abs( incy ) )
694 END IF
695 isame( 11 ) = incys.EQ.incy
696 ELSE IF( banded )THEN
697 isame( 4 ) = kls.EQ.kl
698 isame( 5 ) = kus.EQ.ku
699 isame( 6 ) = als.EQ.alpha
700 isame( 7 ) =
lde( as, aa, laa )
701 isame( 8 ) = ldas.EQ.lda
702 isame( 9 ) =
lde( xs, xx, lx )
703 isame( 10 ) = incxs.EQ.incx
704 isame( 11 ) = bls.EQ.beta
705 IF( null )THEN
706 isame( 12 ) =
lde( ys, yy, ly )
707 ELSE
708 isame( 12 ) =
lderes(
'ge',
' ', 1,
709 $ ml, ys, yy,
710 $ abs( incy ) )
711 END IF
712 isame( 13 ) = incys.EQ.incy
713 END IF
714
715
716
717
718 same = .true.
719 DO 40 i = 1, nargs
720 same = same.AND.isame( i )
721 IF( .NOT.isame( i ) )
722 $ WRITE( nout, fmt = 9998 )i
723 40 CONTINUE
724 IF( .NOT.same )THEN
725 fatal = .true.
726 GO TO 130
727 END IF
728
729 IF( .NOT.null )THEN
730
731
732
733 CALL dmvch( trans, m, n, alpha, a,
734 $ nmax, x, incx, beta, y,
735 $ incy, yt, g, yy, eps, err,
736 $ fatal, nout, .true. )
737 errmax = max( errmax, err )
738
739
740 IF( fatal )
741 $ GO TO 130
742 ELSE
743
744
745 GO TO 110
746 END IF
747
748 50 CONTINUE
749
750 60 CONTINUE
751
752 70 CONTINUE
753
754 80 CONTINUE
755
756 90 CONTINUE
757
758 100 CONTINUE
759
760 110 CONTINUE
761
762 120 CONTINUE
763
764
765
766 IF( errmax.LT.thresh )THEN
767 IF ( iorder.EQ.0) WRITE( nout, fmt = 10000 )sname, nc
768 IF ( iorder.EQ.1) WRITE( nout, fmt = 10001 )sname, nc
769 ELSE
770 IF ( iorder.EQ.0) WRITE( nout, fmt = 10002 )sname, nc, errmax
771 IF ( iorder.EQ.1) WRITE( nout, fmt = 10003 )sname, nc, errmax
772 END IF
773 GO TO 140
774
775 130 CONTINUE
776 WRITE( nout, fmt = 9996 )sname
777 IF( full )THEN
778 WRITE( nout, fmt = 9994 )nc, sname, ctrans, m, n, alpha, lda,
779 $ incx, beta, incy
780 ELSE IF( banded )THEN
781 WRITE( nout, fmt = 9995 )nc, sname, ctrans, m, n, kl, ku,
782 $ alpha, lda, incx, beta, incy
783 END IF
784
785 140 CONTINUE
786 RETURN
787
78810003 FORMAT( ' ', a12,' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
789 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
790 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
79110002 FORMAT( ' ', a12,' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
792 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
793 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
79410001 FORMAT( ' ', a12,' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
795 $ ' (', i6, ' CALL', 'S)' )
79610000 FORMAT( ' ', a12,' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
797 $ ' (', i6, ' CALL', 'S)' )
798 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
799 $ 'ANGED INCORRECTLY *******' )
800 9997 FORMAT( ' ',a12, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
801 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
802 $ ' - SUSPECT *******' )
803 9996 FORMAT( ' ******* ',a12, ' FAILED ON CALL NUMBER:' )
804 9995 FORMAT( 1x, i6, ': ',a12, '(', a14, ',', 4( i3, ',' ), f4.1,
805 $ ', A,', i3, ',',/ 10x,'X,', i2, ',', f4.1, ', Y,',
806 $ i2, ') .' )
807 9994 FORMAT( 1x, i6, ': ',a12, '(', a14, ',', 2( i3, ',' ), f4.1,
808 $ ', A,', i3, ', X,', i2, ',', f4.1, ', Y,', i2,
809 $ ') .' )
810 9993 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
811 $ '******' )
812
813
814
subroutine dmvch(trans, m, n, alpha, a, nmax, x, incx, beta, y, incy, yt, g, yy, eps, err, fatal, nout, mv)
logical function lde(ri, rj, lr)
logical function lderes(type, uplo, m, n, aa, as, lda)
subroutine dmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)