1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577 DOUBLE PRECISION ZERO, HALF, ONE
1578 parameter( zero = 0.0d0, half = 0.5d0, one = 1.0d0 )
1579
1580 DOUBLE PRECISION EPS, THRESH
1581 INTEGER INCMAX, NALF, NIDIM, NINC, NMAX, NOUT, NTRA,
1582 $ IORDER
1583 LOGICAL FATAL, REWI, TRACE
1584 CHARACTER*12 SNAME
1585
1586 DOUBLE PRECISION A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
1587 $ AS( NMAX*NMAX ), G( NMAX ), X( NMAX ),
1588 $ XS( NMAX*INCMAX ), XX( NMAX*INCMAX ),
1589 $ Y( NMAX ), YS( NMAX*INCMAX ), YT( NMAX ),
1590 $ YY( NMAX*INCMAX ), Z( NMAX )
1591 INTEGER IDIM( NIDIM ), INC( NINC )
1592
1593 DOUBLE PRECISION ALPHA, ALS, ERR, ERRMAX, TRANSL
1594 INTEGER I, IA, IM, IN, INCX, INCXS, INCY, INCYS, IX,
1595 $ IY, J, LAA, LDA, LDAS, LX, LY, M, MS, N, NARGS,
1596 $ NC, ND, NS
1597 LOGICAL NULL, RESET, SAME
1598
1599 DOUBLE PRECISION W( 1 )
1600 LOGICAL ISAME( 13 )
1601
1602 LOGICAL LDE, LDERES
1604
1606
1607 INTRINSIC abs, max, min
1608
1609 INTEGER INFOT, NOUTC
1610 LOGICAL OK
1611
1612 COMMON /infoc/infot, noutc, ok
1613
1614
1615 nargs = 9
1616
1617 nc = 0
1618 reset = .true.
1619 errmax = zero
1620
1621 DO 120 in = 1, nidim
1622 n = idim( in )
1623 nd = n/2 + 1
1624
1625 DO 110 im = 1, 2
1626 IF( im.EQ.1 )
1627 $ m = max( n - nd, 0 )
1628 IF( im.EQ.2 )
1629 $ m = min( n + nd, nmax )
1630
1631
1632 lda = m
1633 IF( lda.LT.nmax )
1634 $ lda = lda + 1
1635
1636 IF( lda.GT.nmax )
1637 $ GO TO 110
1638 laa = lda*n
1639 null = n.LE.0.OR.m.LE.0
1640
1641 DO 100 ix = 1, ninc
1642 incx = inc( ix )
1643 lx = abs( incx )*m
1644
1645
1646
1647 transl = half
1648 CALL dmake(
'ge',
' ',
' ', 1, m, x, 1, xx, abs( incx ),
1649 $ 0, m - 1, reset, transl )
1650 IF( m.GT.1 )THEN
1651 x( m/2 ) = zero
1652 xx( 1 + abs( incx )*( m/2 - 1 ) ) = zero
1653 END IF
1654
1655 DO 90 iy = 1, ninc
1656 incy = inc( iy )
1657 ly = abs( incy )*n
1658
1659
1660
1661 transl = zero
1662 CALL dmake(
'ge',
' ',
' ', 1, n, y, 1, yy,
1663 $ abs( incy ), 0, n - 1, reset, transl )
1664 IF( n.GT.1 )THEN
1665 y( n/2 ) = zero
1666 yy( 1 + abs( incy )*( n/2 - 1 ) ) = zero
1667 END IF
1668
1669 DO 80 ia = 1, nalf
1670 alpha = alf( ia )
1671
1672
1673
1674 transl = zero
1675 CALL dmake( sname( 8: 9 ),
' ',
' ', m, n, a, nmax,
1676 $ aa, lda, m - 1, n - 1, reset, transl )
1677
1678 nc = nc + 1
1679
1680
1681
1682 ms = m
1683 ns = n
1684 als = alpha
1685 DO 10 i = 1, laa
1686 as( i ) = aa( i )
1687 10 CONTINUE
1688 ldas = lda
1689 DO 20 i = 1, lx
1690 xs( i ) = xx( i )
1691 20 CONTINUE
1692 incxs = incx
1693 DO 30 i = 1, ly
1694 ys( i ) = yy( i )
1695 30 CONTINUE
1696 incys = incy
1697
1698
1699
1700 IF( trace )
1701 $ WRITE( ntra, fmt = 9994 )nc, sname, m, n,
1702 $ alpha, incx, incy, lda
1703 IF( rewi )
1704 $ rewind ntra
1705 CALL cdger( iorder, m, n, alpha, xx, incx, yy,
1706 $ incy, aa, lda )
1707
1708
1709
1710 IF( .NOT.ok )THEN
1711 WRITE( nout, fmt = 9993 )
1712 fatal = .true.
1713 GO TO 140
1714 END IF
1715
1716
1717
1718 isame( 1 ) = ms.EQ.m
1719 isame( 2 ) = ns.EQ.n
1720 isame( 3 ) = als.EQ.alpha
1721 isame( 4 ) =
lde( xs, xx, lx )
1722 isame( 5 ) = incxs.EQ.incx
1723 isame( 6 ) =
lde( ys, yy, ly )
1724 isame( 7 ) = incys.EQ.incy
1725 IF( null )THEN
1726 isame( 8 ) =
lde( as, aa, laa )
1727 ELSE
1728 isame( 8 ) =
lderes(
'ge',
' ', m, n, as, aa,
1729 $ lda )
1730 END IF
1731 isame( 9 ) = ldas.EQ.lda
1732
1733
1734
1735 same = .true.
1736 DO 40 i = 1, nargs
1737 same = same.AND.isame( i )
1738 IF( .NOT.isame( i ) )
1739 $ WRITE( nout, fmt = 9998 )i
1740 40 CONTINUE
1741 IF( .NOT.same )THEN
1742 fatal = .true.
1743 GO TO 140
1744 END IF
1745
1746 IF( .NOT.null )THEN
1747
1748
1749
1750 IF( incx.GT.0 )THEN
1751 DO 50 i = 1, m
1752 z( i ) = x( i )
1753 50 CONTINUE
1754 ELSE
1755 DO 60 i = 1, m
1756 z( i ) = x( m - i + 1 )
1757 60 CONTINUE
1758 END IF
1759 DO 70 j = 1, n
1760 IF( incy.GT.0 )THEN
1761 w( 1 ) = y( j )
1762 ELSE
1763 w( 1 ) = y( n - j + 1 )
1764 END IF
1765 CALL dmvch(
'N', m, 1, alpha, z, nmax, w, 1,
1766 $ one, a( 1, j ), 1, yt, g,
1767 $ aa( 1 + ( j - 1 )*lda ), eps,
1768 $ err, fatal, nout, .true. )
1769 errmax = max( errmax, err )
1770
1771 IF( fatal )
1772 $ GO TO 130
1773 70 CONTINUE
1774 ELSE
1775
1776 GO TO 110
1777 END IF
1778
1779 80 CONTINUE
1780
1781 90 CONTINUE
1782
1783 100 CONTINUE
1784
1785 110 CONTINUE
1786
1787 120 CONTINUE
1788
1789
1790
1791 IF( errmax.LT.thresh )THEN
1792 IF ( iorder.EQ.0) WRITE( nout, fmt = 10000 )sname, nc
1793 IF ( iorder.EQ.1) WRITE( nout, fmt = 10001 )sname, nc
1794 ELSE
1795 IF ( iorder.EQ.0) WRITE( nout, fmt = 10002 )sname, nc, errmax
1796 IF ( iorder.EQ.1) WRITE( nout, fmt = 10003 )sname, nc, errmax
1797 END IF
1798 GO TO 150
1799
1800 130 CONTINUE
1801 WRITE( nout, fmt = 9995 )j
1802
1803 140 CONTINUE
1804 WRITE( nout, fmt = 9996 )sname
1805 WRITE( nout, fmt = 9994 )nc, sname, m, n, alpha, incx, incy, lda
1806
1807 150 CONTINUE
1808 RETURN
1809
181010003 FORMAT( ' ', a12,' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1811 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1812 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
181310002 FORMAT( ' ', a12,' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1814 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1815 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
181610001 FORMAT( ' ', a12,' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1817 $ ' (', i6, ' CALL', 'S)' )
181810000 FORMAT( ' ', a12,' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1819 $ ' (', i6, ' CALL', 'S)' )
1820 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
1821 $ 'ANGED INCORRECTLY *******' )
1822 9997 FORMAT( ' ',a12, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
1823 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
1824 $ ' - SUSPECT *******' )
1825 9996 FORMAT( ' ******* ',a12, ' FAILED ON CALL NUMBER:' )
1826 9995 FORMAT( ' THESE ARE THE RESULTS FOR COLUMN ', i3 )
1827 9994 FORMAT( 1x, i6, ': ',a12, '(', 2( i3, ',' ), f4.1, ', X,', i2,
1828 $ ', Y,', i2, ', A,', i3, ') .' )
1829 9993 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1830 $ '******' )
1831
1832
1833
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)
subroutine dger(m, n, alpha, x, incx, y, incy, a, lda)
DGER