LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cchk5()

subroutine cchk5 ( character*6  sname,
real  eps,
real  thresh,
integer  nout,
integer  ntra,
logical  trace,
logical  rewi,
logical  fatal,
integer  nidim,
integer, dimension( nidim )  idim,
integer  nalf,
complex, dimension( nalf )  alf,
integer  ninc,
integer, dimension( ninc )  inc,
integer  nmax,
integer  incmax,
complex, dimension( nmax, nmax )  a,
complex, dimension( nmax*nmax )  aa,
complex, dimension( nmax*nmax )  as,
complex, dimension( nmax )  x,
complex, dimension( nmax*incmax )  xx,
complex, dimension( nmax*incmax )  xs,
complex, dimension( nmax )  y,
complex, dimension( nmax*incmax )  yy,
complex, dimension( nmax*incmax )  ys,
complex, dimension( nmax )  yt,
real, dimension( nmax )  g,
complex, dimension( nmax )  z 
)

Definition at line 1793 of file cblat2.f.

1797*
1798* Tests CHER and CHPR.
1799*
1800* Auxiliary routine for test program for Level 2 Blas.
1801*
1802* -- Written on 10-August-1987.
1803* Richard Hanson, Sandia National Labs.
1804* Jeremy Du Croz, NAG Central Office.
1805*
1806* .. Parameters ..
1807 COMPLEX ZERO, HALF, ONE
1808 parameter( zero = ( 0.0, 0.0 ), half = ( 0.5, 0.0 ),
1809 $ one = ( 1.0, 0.0 ) )
1810 REAL RZERO
1811 parameter( rzero = 0.0 )
1812* .. Scalar Arguments ..
1813 REAL EPS, THRESH
1814 INTEGER INCMAX, NALF, NIDIM, NINC, NMAX, NOUT, NTRA
1815 LOGICAL FATAL, REWI, TRACE
1816 CHARACTER*6 SNAME
1817* .. Array Arguments ..
1818 COMPLEX A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
1819 $ AS( NMAX*NMAX ), X( NMAX ), XS( NMAX*INCMAX ),
1820 $ XX( NMAX*INCMAX ), Y( NMAX ),
1821 $ YS( NMAX*INCMAX ), YT( NMAX ),
1822 $ YY( NMAX*INCMAX ), Z( NMAX )
1823 REAL G( NMAX )
1824 INTEGER IDIM( NIDIM ), INC( NINC )
1825* .. Local Scalars ..
1826 COMPLEX ALPHA, TRANSL
1827 REAL ERR, ERRMAX, RALPHA, RALS
1828 INTEGER I, IA, IC, IN, INCX, INCXS, IX, J, JA, JJ, LAA,
1829 $ LDA, LDAS, LJ, LX, N, NARGS, NC, NS
1830 LOGICAL FULL, NULL, PACKED, RESET, SAME, UPPER
1831 CHARACTER*1 UPLO, UPLOS
1832 CHARACTER*2 ICH
1833* .. Local Arrays ..
1834 COMPLEX W( 1 )
1835 LOGICAL ISAME( 13 )
1836* .. External Functions ..
1837 LOGICAL LCE, LCERES
1838 EXTERNAL lce, lceres
1839* .. External Subroutines ..
1840 EXTERNAL cher, chpr, cmake, cmvch
1841* .. Intrinsic Functions ..
1842 INTRINSIC abs, cmplx, conjg, max, real
1843* .. Scalars in Common ..
1844 INTEGER INFOT, NOUTC
1845 LOGICAL LERR, OK
1846* .. Common blocks ..
1847 COMMON /infoc/infot, noutc, ok, lerr
1848* .. Data statements ..
1849 DATA ich/'UL'/
1850* .. Executable Statements ..
1851 full = sname( 3: 3 ).EQ.'E'
1852 packed = sname( 3: 3 ).EQ.'P'
1853* Define the number of arguments.
1854 IF( full )THEN
1855 nargs = 7
1856 ELSE IF( packed )THEN
1857 nargs = 6
1858 END IF
1859*
1860 nc = 0
1861 reset = .true.
1862 errmax = rzero
1863*
1864 DO 100 in = 1, nidim
1865 n = idim( in )
1866* Set LDA to 1 more than minimum value if room.
1867 lda = n
1868 IF( lda.LT.nmax )
1869 $ lda = lda + 1
1870* Skip tests if not enough room.
1871 IF( lda.GT.nmax )
1872 $ GO TO 100
1873 IF( packed )THEN
1874 laa = ( n*( n + 1 ) )/2
1875 ELSE
1876 laa = lda*n
1877 END IF
1878*
1879 DO 90 ic = 1, 2
1880 uplo = ich( ic: ic )
1881 upper = uplo.EQ.'U'
1882*
1883 DO 80 ix = 1, ninc
1884 incx = inc( ix )
1885 lx = abs( incx )*n
1886*
1887* Generate the vector X.
1888*
1889 transl = half
1890 CALL cmake( 'GE', ' ', ' ', 1, n, x, 1, xx, abs( incx ),
1891 $ 0, n - 1, reset, transl )
1892 IF( n.GT.1 )THEN
1893 x( n/2 ) = zero
1894 xx( 1 + abs( incx )*( n/2 - 1 ) ) = zero
1895 END IF
1896*
1897 DO 70 ia = 1, nalf
1898 ralpha = real( alf( ia ) )
1899 alpha = cmplx( ralpha, rzero )
1900 null = n.LE.0.OR.ralpha.EQ.rzero
1901*
1902* Generate the matrix A.
1903*
1904 transl = zero
1905 CALL cmake( sname( 2: 3 ), uplo, ' ', n, n, a, nmax,
1906 $ aa, lda, n - 1, n - 1, reset, transl )
1907*
1908 nc = nc + 1
1909*
1910* Save every datum before calling the subroutine.
1911*
1912 uplos = uplo
1913 ns = n
1914 rals = ralpha
1915 DO 10 i = 1, laa
1916 as( i ) = aa( i )
1917 10 CONTINUE
1918 ldas = lda
1919 DO 20 i = 1, lx
1920 xs( i ) = xx( i )
1921 20 CONTINUE
1922 incxs = incx
1923*
1924* Call the subroutine.
1925*
1926 IF( full )THEN
1927 IF( trace )
1928 $ WRITE( ntra, fmt = 9993 )nc, sname, uplo, n,
1929 $ ralpha, incx, lda
1930 IF( rewi )
1931 $ rewind ntra
1932 CALL cher( uplo, n, ralpha, xx, incx, aa, lda )
1933 ELSE IF( packed )THEN
1934 IF( trace )
1935 $ WRITE( ntra, fmt = 9994 )nc, sname, uplo, n,
1936 $ ralpha, incx
1937 IF( rewi )
1938 $ rewind ntra
1939 CALL chpr( uplo, n, ralpha, xx, incx, aa )
1940 END IF
1941*
1942* Check if error-exit was taken incorrectly.
1943*
1944 IF( .NOT.ok )THEN
1945 WRITE( nout, fmt = 9992 )
1946 fatal = .true.
1947 GO TO 120
1948 END IF
1949*
1950* See what data changed inside subroutines.
1951*
1952 isame( 1 ) = uplo.EQ.uplos
1953 isame( 2 ) = ns.EQ.n
1954 isame( 3 ) = rals.EQ.ralpha
1955 isame( 4 ) = lce( xs, xx, lx )
1956 isame( 5 ) = incxs.EQ.incx
1957 IF( null )THEN
1958 isame( 6 ) = lce( as, aa, laa )
1959 ELSE
1960 isame( 6 ) = lceres( sname( 2: 3 ), uplo, n, n, as,
1961 $ aa, lda )
1962 END IF
1963 IF( .NOT.packed )THEN
1964 isame( 7 ) = ldas.EQ.lda
1965 END IF
1966*
1967* If data was incorrectly changed, report and return.
1968*
1969 same = .true.
1970 DO 30 i = 1, nargs
1971 same = same.AND.isame( i )
1972 IF( .NOT.isame( i ) )
1973 $ WRITE( nout, fmt = 9998 )i
1974 30 CONTINUE
1975 IF( .NOT.same )THEN
1976 fatal = .true.
1977 GO TO 120
1978 END IF
1979*
1980 IF( .NOT.null )THEN
1981*
1982* Check the result column by column.
1983*
1984 IF( incx.GT.0 )THEN
1985 DO 40 i = 1, n
1986 z( i ) = x( i )
1987 40 CONTINUE
1988 ELSE
1989 DO 50 i = 1, n
1990 z( i ) = x( n - i + 1 )
1991 50 CONTINUE
1992 END IF
1993 ja = 1
1994 DO 60 j = 1, n
1995 w( 1 ) = conjg( z( j ) )
1996 IF( upper )THEN
1997 jj = 1
1998 lj = j
1999 ELSE
2000 jj = j
2001 lj = n - j + 1
2002 END IF
2003 CALL cmvch( 'N', lj, 1, alpha, z( jj ), lj, w,
2004 $ 1, one, a( jj, j ), 1, yt, g,
2005 $ aa( ja ), eps, err, fatal, nout,
2006 $ .true. )
2007 IF( full )THEN
2008 IF( upper )THEN
2009 ja = ja + lda
2010 ELSE
2011 ja = ja + lda + 1
2012 END IF
2013 ELSE
2014 ja = ja + lj
2015 END IF
2016 errmax = max( errmax, err )
2017* If got really bad answer, report and return.
2018 IF( fatal )
2019 $ GO TO 110
2020 60 CONTINUE
2021 ELSE
2022* Avoid repeating tests if N.le.0.
2023 IF( n.LE.0 )
2024 $ GO TO 100
2025 END IF
2026*
2027 70 CONTINUE
2028*
2029 80 CONTINUE
2030*
2031 90 CONTINUE
2032*
2033 100 CONTINUE
2034*
2035* Report result.
2036*
2037 IF( errmax.LT.thresh )THEN
2038 WRITE( nout, fmt = 9999 )sname, nc
2039 ELSE
2040 WRITE( nout, fmt = 9997 )sname, nc, errmax
2041 END IF
2042 GO TO 130
2043*
2044 110 CONTINUE
2045 WRITE( nout, fmt = 9995 )j
2046*
2047 120 CONTINUE
2048 WRITE( nout, fmt = 9996 )sname
2049 IF( full )THEN
2050 WRITE( nout, fmt = 9993 )nc, sname, uplo, n, ralpha, incx, lda
2051 ELSE IF( packed )THEN
2052 WRITE( nout, fmt = 9994 )nc, sname, uplo, n, ralpha, incx
2053 END IF
2054*
2055 130 CONTINUE
2056 RETURN
2057*
2058 9999 FORMAT( ' ', a6, ' PASSED THE COMPUTATIONAL TESTS (', i6, ' CALL',
2059 $ 'S)' )
2060 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
2061 $ 'ANGED INCORRECTLY *******' )
2062 9997 FORMAT( ' ', a6, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
2063 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
2064 $ ' - SUSPECT *******' )
2065 9996 FORMAT( ' ******* ', a6, ' FAILED ON CALL NUMBER:' )
2066 9995 FORMAT( ' THESE ARE THE RESULTS FOR COLUMN ', i3 )
2067 9994 FORMAT( 1x, i6, ': ', a6, '(''', a1, ''',', i3, ',', f4.1, ', X,',
2068 $ i2, ', AP) .' )
2069 9993 FORMAT( 1x, i6, ': ', a6, '(''', a1, ''',', i3, ',', f4.1, ', X,',
2070 $ i2, ', A,', i3, ') .' )
2071 9992 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
2072 $ '******' )
2073*
2074* End of CCHK5
2075*
subroutine cmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
Definition cblat2.f:2744
logical function lceres(type, uplo, m, n, aa, as, lda)
Definition cblat2.f:3097
subroutine cmvch(trans, m, n, alpha, a, nmax, x, incx, beta, y, incy, yt, g, yy, eps, err, fatal, nout, mv)
Definition cblat2.f:2936
logical function lce(ri, rj, lr)
Definition cblat2.f:3067
subroutine cher(uplo, n, alpha, x, incx, a, lda)
CHER
Definition cher.f:135
subroutine chpr(uplo, n, alpha, x, incx, ap)
CHPR
Definition chpr.f:130
Here is the call graph for this function:
Here is the caller graph for this function: