LAPACK 3.3.1
Linear Algebra PACKage

zblat1.f

Go to the documentation of this file.
00001       PROGRAM ZBLAT1
00002 *     Test program for the COMPLEX*16 Level 1 BLAS.
00003 *     Based upon the original BLAS test routine together with:
00004 *     F06GAF Example Program Text
00005 *     .. Parameters ..
00006       INTEGER          NOUT
00007       PARAMETER        (NOUT=6)
00008 *     .. Scalars in Common ..
00009       INTEGER          ICASE, INCX, INCY, MODE, N
00010       LOGICAL          PASS
00011 *     .. Local Scalars ..
00012       DOUBLE PRECISION SFAC
00013       INTEGER          IC
00014 *     .. External Subroutines ..
00015       EXTERNAL         CHECK1, CHECK2, HEADER
00016 *     .. Common blocks ..
00017       COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00018 *     .. Data statements ..
00019       DATA             SFAC/9.765625D-4/
00020 *     .. Executable Statements ..
00021       WRITE (NOUT,99999)
00022       DO 20 IC = 1, 10
00023          ICASE = IC
00024          CALL HEADER
00025 *
00026 *        Initialize PASS, INCX, INCY, and MODE for a new case.
00027 *        The value 9999 for INCX, INCY or MODE will appear in the
00028 *        detailed  output, if any, for cases that do not involve
00029 *        these parameters.
00030 *
00031          PASS = .TRUE.
00032          INCX = 9999
00033          INCY = 9999
00034          MODE = 9999
00035          IF (ICASE.LE.5) THEN
00036             CALL CHECK2(SFAC)
00037          ELSE IF (ICASE.GE.6) THEN
00038             CALL CHECK1(SFAC)
00039          END IF
00040 *        -- Print
00041          IF (PASS) WRITE (NOUT,99998)
00042    20 CONTINUE
00043       STOP
00044 *
00045 99999 FORMAT (' Complex BLAS Test Program Results',/1X)
00046 99998 FORMAT ('                                    ----- PASS -----')
00047       END
00048       SUBROUTINE HEADER
00049 *     .. Parameters ..
00050       INTEGER          NOUT
00051       PARAMETER        (NOUT=6)
00052 *     .. Scalars in Common ..
00053       INTEGER          ICASE, INCX, INCY, MODE, N
00054       LOGICAL          PASS
00055 *     .. Local Arrays ..
00056       CHARACTER*6      L(10)
00057 *     .. Common blocks ..
00058       COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00059 *     .. Data statements ..
00060       DATA             L(1)/'ZDOTC '/
00061       DATA             L(2)/'ZDOTU '/
00062       DATA             L(3)/'ZAXPY '/
00063       DATA             L(4)/'ZCOPY '/
00064       DATA             L(5)/'ZSWAP '/
00065       DATA             L(6)/'DZNRM2'/
00066       DATA             L(7)/'DZASUM'/
00067       DATA             L(8)/'ZSCAL '/
00068       DATA             L(9)/'ZDSCAL'/
00069       DATA             L(10)/'IZAMAX'/
00070 *     .. Executable Statements ..
00071       WRITE (NOUT,99999) ICASE, L(ICASE)
00072       RETURN
00073 *
00074 99999 FORMAT (/' Test of subprogram number',I3,12X,A6)
00075       END
00076       SUBROUTINE CHECK1(SFAC)
00077 *     .. Parameters ..
00078       INTEGER           NOUT
00079       PARAMETER         (NOUT=6)
00080 *     .. Scalar Arguments ..
00081       DOUBLE PRECISION  SFAC
00082 *     .. Scalars in Common ..
00083       INTEGER           ICASE, INCX, INCY, MODE, N
00084       LOGICAL           PASS
00085 *     .. Local Scalars ..
00086       COMPLEX*16        CA
00087       DOUBLE PRECISION  SA
00088       INTEGER           I, J, LEN, NP1
00089 *     .. Local Arrays ..
00090       COMPLEX*16        CTRUE5(8,5,2), CTRUE6(8,5,2), CV(8,5,2), CX(8),
00091      +                  MWPCS(5), MWPCT(5)
00092       DOUBLE PRECISION  STRUE2(5), STRUE4(5)
00093       INTEGER           ITRUE3(5)
00094 *     .. External Functions ..
00095       DOUBLE PRECISION  DZASUM, DZNRM2
00096       INTEGER           IZAMAX
00097       EXTERNAL          DZASUM, DZNRM2, IZAMAX
00098 *     .. External Subroutines ..
00099       EXTERNAL          ZSCAL, ZDSCAL, CTEST, ITEST1, STEST1
00100 *     .. Intrinsic Functions ..
00101       INTRINSIC         MAX
00102 *     .. Common blocks ..
00103       COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00104 *     .. Data statements ..
00105       DATA              SA, CA/0.3D0, (0.4D0,-0.7D0)/
00106       DATA              ((CV(I,J,1),I=1,8),J=1,5)/(0.1D0,0.1D0),
00107      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00108      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00109      +                  (1.0D0,2.0D0), (0.3D0,-0.4D0), (3.0D0,4.0D0),
00110      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00111      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00112      +                  (0.1D0,-0.3D0), (0.5D0,-0.1D0), (5.0D0,6.0D0),
00113      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (5.0D0,6.0D0),
00114      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (0.1D0,0.1D0),
00115      +                  (-0.6D0,0.1D0), (0.1D0,-0.3D0), (7.0D0,8.0D0),
00116      +                  (7.0D0,8.0D0), (7.0D0,8.0D0), (7.0D0,8.0D0),
00117      +                  (7.0D0,8.0D0), (0.3D0,0.1D0), (0.5D0,0.0D0),
00118      +                  (0.0D0,0.5D0), (0.0D0,0.2D0), (2.0D0,3.0D0),
00119      +                  (2.0D0,3.0D0), (2.0D0,3.0D0), (2.0D0,3.0D0)/
00120       DATA              ((CV(I,J,2),I=1,8),J=1,5)/(0.1D0,0.1D0),
00121      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00122      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00123      +                  (4.0D0,5.0D0), (0.3D0,-0.4D0), (6.0D0,7.0D0),
00124      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00125      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00126      +                  (0.1D0,-0.3D0), (8.0D0,9.0D0), (0.5D0,-0.1D0),
00127      +                  (2.0D0,5.0D0), (2.0D0,5.0D0), (2.0D0,5.0D0),
00128      +                  (2.0D0,5.0D0), (2.0D0,5.0D0), (0.1D0,0.1D0),
00129      +                  (3.0D0,6.0D0), (-0.6D0,0.1D0), (4.0D0,7.0D0),
00130      +                  (0.1D0,-0.3D0), (7.0D0,2.0D0), (7.0D0,2.0D0),
00131      +                  (7.0D0,2.0D0), (0.3D0,0.1D0), (5.0D0,8.0D0),
00132      +                  (0.5D0,0.0D0), (6.0D0,9.0D0), (0.0D0,0.5D0),
00133      +                  (8.0D0,3.0D0), (0.0D0,0.2D0), (9.0D0,4.0D0)/
00134       DATA              STRUE2/0.0D0, 0.5D0, 0.6D0, 0.7D0, 0.8D0/
00135       DATA              STRUE4/0.0D0, 0.7D0, 1.0D0, 1.3D0, 1.6D0/
00136       DATA              ((CTRUE5(I,J,1),I=1,8),J=1,5)/(0.1D0,0.1D0),
00137      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00138      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00139      +                  (1.0D0,2.0D0), (-0.16D0,-0.37D0), (3.0D0,4.0D0),
00140      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00141      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00142      +                  (-0.17D0,-0.19D0), (0.13D0,-0.39D0),
00143      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (5.0D0,6.0D0),
00144      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (5.0D0,6.0D0),
00145      +                  (0.11D0,-0.03D0), (-0.17D0,0.46D0),
00146      +                  (-0.17D0,-0.19D0), (7.0D0,8.0D0), (7.0D0,8.0D0),
00147      +                  (7.0D0,8.0D0), (7.0D0,8.0D0), (7.0D0,8.0D0),
00148      +                  (0.19D0,-0.17D0), (0.20D0,-0.35D0),
00149      +                  (0.35D0,0.20D0), (0.14D0,0.08D0),
00150      +                  (2.0D0,3.0D0), (2.0D0,3.0D0), (2.0D0,3.0D0),
00151      +                  (2.0D0,3.0D0)/
00152       DATA              ((CTRUE5(I,J,2),I=1,8),J=1,5)/(0.1D0,0.1D0),
00153      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00154      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00155      +                  (4.0D0,5.0D0), (-0.16D0,-0.37D0), (6.0D0,7.0D0),
00156      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00157      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00158      +                  (-0.17D0,-0.19D0), (8.0D0,9.0D0),
00159      +                  (0.13D0,-0.39D0), (2.0D0,5.0D0), (2.0D0,5.0D0),
00160      +                  (2.0D0,5.0D0), (2.0D0,5.0D0), (2.0D0,5.0D0),
00161      +                  (0.11D0,-0.03D0), (3.0D0,6.0D0),
00162      +                  (-0.17D0,0.46D0), (4.0D0,7.0D0),
00163      +                  (-0.17D0,-0.19D0), (7.0D0,2.0D0), (7.0D0,2.0D0),
00164      +                  (7.0D0,2.0D0), (0.19D0,-0.17D0), (5.0D0,8.0D0),
00165      +                  (0.20D0,-0.35D0), (6.0D0,9.0D0),
00166      +                  (0.35D0,0.20D0), (8.0D0,3.0D0),
00167      +                  (0.14D0,0.08D0), (9.0D0,4.0D0)/
00168       DATA              ((CTRUE6(I,J,1),I=1,8),J=1,5)/(0.1D0,0.1D0),
00169      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00170      +                  (1.0D0,2.0D0), (1.0D0,2.0D0), (1.0D0,2.0D0),
00171      +                  (1.0D0,2.0D0), (0.09D0,-0.12D0), (3.0D0,4.0D0),
00172      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00173      +                  (3.0D0,4.0D0), (3.0D0,4.0D0), (3.0D0,4.0D0),
00174      +                  (0.03D0,-0.09D0), (0.15D0,-0.03D0),
00175      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (5.0D0,6.0D0),
00176      +                  (5.0D0,6.0D0), (5.0D0,6.0D0), (5.0D0,6.0D0),
00177      +                  (0.03D0,0.03D0), (-0.18D0,0.03D0),
00178      +                  (0.03D0,-0.09D0), (7.0D0,8.0D0), (7.0D0,8.0D0),
00179      +                  (7.0D0,8.0D0), (7.0D0,8.0D0), (7.0D0,8.0D0),
00180      +                  (0.09D0,0.03D0), (0.15D0,0.00D0),
00181      +                  (0.00D0,0.15D0), (0.00D0,0.06D0), (2.0D0,3.0D0),
00182      +                  (2.0D0,3.0D0), (2.0D0,3.0D0), (2.0D0,3.0D0)/
00183       DATA              ((CTRUE6(I,J,2),I=1,8),J=1,5)/(0.1D0,0.1D0),
00184      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00185      +                  (4.0D0,5.0D0), (4.0D0,5.0D0), (4.0D0,5.0D0),
00186      +                  (4.0D0,5.0D0), (0.09D0,-0.12D0), (6.0D0,7.0D0),
00187      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00188      +                  (6.0D0,7.0D0), (6.0D0,7.0D0), (6.0D0,7.0D0),
00189      +                  (0.03D0,-0.09D0), (8.0D0,9.0D0),
00190      +                  (0.15D0,-0.03D0), (2.0D0,5.0D0), (2.0D0,5.0D0),
00191      +                  (2.0D0,5.0D0), (2.0D0,5.0D0), (2.0D0,5.0D0),
00192      +                  (0.03D0,0.03D0), (3.0D0,6.0D0),
00193      +                  (-0.18D0,0.03D0), (4.0D0,7.0D0),
00194      +                  (0.03D0,-0.09D0), (7.0D0,2.0D0), (7.0D0,2.0D0),
00195      +                  (7.0D0,2.0D0), (0.09D0,0.03D0), (5.0D0,8.0D0),
00196      +                  (0.15D0,0.00D0), (6.0D0,9.0D0), (0.00D0,0.15D0),
00197      +                  (8.0D0,3.0D0), (0.00D0,0.06D0), (9.0D0,4.0D0)/
00198       DATA              ITRUE3/0, 1, 2, 2, 2/
00199 *     .. Executable Statements ..
00200       DO 60 INCX = 1, 2
00201          DO 40 NP1 = 1, 5
00202             N = NP1 - 1
00203             LEN = 2*MAX(N,1)
00204 *           .. Set vector arguments ..
00205             DO 20 I = 1, LEN
00206                CX(I) = CV(I,NP1,INCX)
00207    20       CONTINUE
00208             IF (ICASE.EQ.6) THEN
00209 *              .. DZNRM2 ..
00210                CALL STEST1(DZNRM2(N,CX,INCX),STRUE2(NP1),STRUE2(NP1),
00211      +                     SFAC)
00212             ELSE IF (ICASE.EQ.7) THEN
00213 *              .. DZASUM ..
00214                CALL STEST1(DZASUM(N,CX,INCX),STRUE4(NP1),STRUE4(NP1),
00215      +                     SFAC)
00216             ELSE IF (ICASE.EQ.8) THEN
00217 *              .. ZSCAL ..
00218                CALL ZSCAL(N,CA,CX,INCX)
00219                CALL CTEST(LEN,CX,CTRUE5(1,NP1,INCX),CTRUE5(1,NP1,INCX),
00220      +                    SFAC)
00221             ELSE IF (ICASE.EQ.9) THEN
00222 *              .. ZDSCAL ..
00223                CALL ZDSCAL(N,SA,CX,INCX)
00224                CALL CTEST(LEN,CX,CTRUE6(1,NP1,INCX),CTRUE6(1,NP1,INCX),
00225      +                    SFAC)
00226             ELSE IF (ICASE.EQ.10) THEN
00227 *              .. IZAMAX ..
00228                CALL ITEST1(IZAMAX(N,CX,INCX),ITRUE3(NP1))
00229             ELSE
00230                WRITE (NOUT,*) ' Shouldn''t be here in CHECK1'
00231                STOP
00232             END IF
00233 *
00234    40    CONTINUE
00235    60 CONTINUE
00236 *
00237       INCX = 1
00238       IF (ICASE.EQ.8) THEN
00239 *        ZSCAL
00240 *        Add a test for alpha equal to zero.
00241          CA = (0.0D0,0.0D0)
00242          DO 80 I = 1, 5
00243             MWPCT(I) = (0.0D0,0.0D0)
00244             MWPCS(I) = (1.0D0,1.0D0)
00245    80    CONTINUE
00246          CALL ZSCAL(5,CA,CX,INCX)
00247          CALL CTEST(5,CX,MWPCT,MWPCS,SFAC)
00248       ELSE IF (ICASE.EQ.9) THEN
00249 *        ZDSCAL
00250 *        Add a test for alpha equal to zero.
00251          SA = 0.0D0
00252          DO 100 I = 1, 5
00253             MWPCT(I) = (0.0D0,0.0D0)
00254             MWPCS(I) = (1.0D0,1.0D0)
00255   100    CONTINUE
00256          CALL ZDSCAL(5,SA,CX,INCX)
00257          CALL CTEST(5,CX,MWPCT,MWPCS,SFAC)
00258 *        Add a test for alpha equal to one.
00259          SA = 1.0D0
00260          DO 120 I = 1, 5
00261             MWPCT(I) = CX(I)
00262             MWPCS(I) = CX(I)
00263   120    CONTINUE
00264          CALL ZDSCAL(5,SA,CX,INCX)
00265          CALL CTEST(5,CX,MWPCT,MWPCS,SFAC)
00266 *        Add a test for alpha equal to minus one.
00267          SA = -1.0D0
00268          DO 140 I = 1, 5
00269             MWPCT(I) = -CX(I)
00270             MWPCS(I) = -CX(I)
00271   140    CONTINUE
00272          CALL ZDSCAL(5,SA,CX,INCX)
00273          CALL CTEST(5,CX,MWPCT,MWPCS,SFAC)
00274       END IF
00275       RETURN
00276       END
00277       SUBROUTINE CHECK2(SFAC)
00278 *     .. Parameters ..
00279       INTEGER           NOUT
00280       PARAMETER         (NOUT=6)
00281 *     .. Scalar Arguments ..
00282       DOUBLE PRECISION  SFAC
00283 *     .. Scalars in Common ..
00284       INTEGER           ICASE, INCX, INCY, MODE, N
00285       LOGICAL           PASS
00286 *     .. Local Scalars ..
00287       COMPLEX*16        CA
00288       INTEGER           I, J, KI, KN, KSIZE, LENX, LENY, MX, MY
00289 *     .. Local Arrays ..
00290       COMPLEX*16        CDOT(1), CSIZE1(4), CSIZE2(7,2), CSIZE3(14),
00291      +                  CT10X(7,4,4), CT10Y(7,4,4), CT6(4,4), CT7(4,4),
00292      +                  CT8(7,4,4), CX(7), CX1(7), CY(7), CY1(7)
00293       INTEGER           INCXS(4), INCYS(4), LENS(4,2), NS(4)
00294 *     .. External Functions ..
00295       COMPLEX*16        ZDOTC, ZDOTU
00296       EXTERNAL          ZDOTC, ZDOTU
00297 *     .. External Subroutines ..
00298       EXTERNAL          ZAXPY, ZCOPY, ZSWAP, CTEST
00299 *     .. Intrinsic Functions ..
00300       INTRINSIC         ABS, MIN
00301 *     .. Common blocks ..
00302       COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00303 *     .. Data statements ..
00304       DATA              CA/(0.4D0,-0.7D0)/
00305       DATA              INCXS/1, 2, -2, -1/
00306       DATA              INCYS/1, -2, 1, -2/
00307       DATA              LENS/1, 1, 2, 4, 1, 1, 3, 7/
00308       DATA              NS/0, 1, 2, 4/
00309       DATA              CX1/(0.7D0,-0.8D0), (-0.4D0,-0.7D0),
00310      +                  (-0.1D0,-0.9D0), (0.2D0,-0.8D0),
00311      +                  (-0.9D0,-0.4D0), (0.1D0,0.4D0), (-0.6D0,0.6D0)/
00312       DATA              CY1/(0.6D0,-0.6D0), (-0.9D0,0.5D0),
00313      +                  (0.7D0,-0.6D0), (0.1D0,-0.5D0), (-0.1D0,-0.2D0),
00314      +                  (-0.5D0,-0.3D0), (0.8D0,-0.7D0)/
00315       DATA              ((CT8(I,J,1),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00316      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00317      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00318      +                  (0.32D0,-1.41D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00319      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00320      +                  (0.0D0,0.0D0), (0.32D0,-1.41D0),
00321      +                  (-1.55D0,0.5D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00322      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00323      +                  (0.32D0,-1.41D0), (-1.55D0,0.5D0),
00324      +                  (0.03D0,-0.89D0), (-0.38D0,-0.96D0),
00325      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0)/
00326       DATA              ((CT8(I,J,2),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00327      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00328      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00329      +                  (0.32D0,-1.41D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00330      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00331      +                  (0.0D0,0.0D0), (-0.07D0,-0.89D0),
00332      +                  (-0.9D0,0.5D0), (0.42D0,-1.41D0), (0.0D0,0.0D0),
00333      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00334      +                  (0.78D0,0.06D0), (-0.9D0,0.5D0),
00335      +                  (0.06D0,-0.13D0), (0.1D0,-0.5D0),
00336      +                  (-0.77D0,-0.49D0), (-0.5D0,-0.3D0),
00337      +                  (0.52D0,-1.51D0)/
00338       DATA              ((CT8(I,J,3),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00339      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00340      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00341      +                  (0.32D0,-1.41D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00342      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00343      +                  (0.0D0,0.0D0), (-0.07D0,-0.89D0),
00344      +                  (-1.18D0,-0.31D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00345      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00346      +                  (0.78D0,0.06D0), (-1.54D0,0.97D0),
00347      +                  (0.03D0,-0.89D0), (-0.18D0,-1.31D0),
00348      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0)/
00349       DATA              ((CT8(I,J,4),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00350      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00351      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00352      +                  (0.32D0,-1.41D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00353      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00354      +                  (0.0D0,0.0D0), (0.32D0,-1.41D0), (-0.9D0,0.5D0),
00355      +                  (0.05D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00356      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.32D0,-1.41D0),
00357      +                  (-0.9D0,0.5D0), (0.05D0,-0.6D0), (0.1D0,-0.5D0),
00358      +                  (-0.77D0,-0.49D0), (-0.5D0,-0.3D0),
00359      +                  (0.32D0,-1.16D0)/
00360       DATA              CT7/(0.0D0,0.0D0), (-0.06D0,-0.90D0),
00361      +                  (0.65D0,-0.47D0), (-0.34D0,-1.22D0),
00362      +                  (0.0D0,0.0D0), (-0.06D0,-0.90D0),
00363      +                  (-0.59D0,-1.46D0), (-1.04D0,-0.04D0),
00364      +                  (0.0D0,0.0D0), (-0.06D0,-0.90D0),
00365      +                  (-0.83D0,0.59D0), (0.07D0,-0.37D0),
00366      +                  (0.0D0,0.0D0), (-0.06D0,-0.90D0),
00367      +                  (-0.76D0,-1.15D0), (-1.33D0,-1.82D0)/
00368       DATA              CT6/(0.0D0,0.0D0), (0.90D0,0.06D0),
00369      +                  (0.91D0,-0.77D0), (1.80D0,-0.10D0),
00370      +                  (0.0D0,0.0D0), (0.90D0,0.06D0), (1.45D0,0.74D0),
00371      +                  (0.20D0,0.90D0), (0.0D0,0.0D0), (0.90D0,0.06D0),
00372      +                  (-0.55D0,0.23D0), (0.83D0,-0.39D0),
00373      +                  (0.0D0,0.0D0), (0.90D0,0.06D0), (1.04D0,0.79D0),
00374      +                  (1.95D0,1.22D0)/
00375       DATA              ((CT10X(I,J,1),I=1,7),J=1,4)/(0.7D0,-0.8D0),
00376      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00377      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00378      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00379      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00380      +                  (0.0D0,0.0D0), (0.6D0,-0.6D0), (-0.9D0,0.5D0),
00381      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00382      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.6D0,-0.6D0),
00383      +                  (-0.9D0,0.5D0), (0.7D0,-0.6D0), (0.1D0,-0.5D0),
00384      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0)/
00385       DATA              ((CT10X(I,J,2),I=1,7),J=1,4)/(0.7D0,-0.8D0),
00386      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00387      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00388      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00389      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00390      +                  (0.0D0,0.0D0), (0.7D0,-0.6D0), (-0.4D0,-0.7D0),
00391      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00392      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.8D0,-0.7D0),
00393      +                  (-0.4D0,-0.7D0), (-0.1D0,-0.2D0),
00394      +                  (0.2D0,-0.8D0), (0.7D0,-0.6D0), (0.1D0,0.4D0),
00395      +                  (0.6D0,-0.6D0)/
00396       DATA              ((CT10X(I,J,3),I=1,7),J=1,4)/(0.7D0,-0.8D0),
00397      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00398      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00399      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00400      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00401      +                  (0.0D0,0.0D0), (-0.9D0,0.5D0), (-0.4D0,-0.7D0),
00402      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00403      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.1D0,-0.5D0),
00404      +                  (-0.4D0,-0.7D0), (0.7D0,-0.6D0), (0.2D0,-0.8D0),
00405      +                  (-0.9D0,0.5D0), (0.1D0,0.4D0), (0.6D0,-0.6D0)/
00406       DATA              ((CT10X(I,J,4),I=1,7),J=1,4)/(0.7D0,-0.8D0),
00407      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00408      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00409      +                  (0.6D0,-0.6D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00410      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00411      +                  (0.0D0,0.0D0), (0.6D0,-0.6D0), (0.7D0,-0.6D0),
00412      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00413      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.6D0,-0.6D0),
00414      +                  (0.7D0,-0.6D0), (-0.1D0,-0.2D0), (0.8D0,-0.7D0),
00415      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0)/
00416       DATA              ((CT10Y(I,J,1),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00417      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00418      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00419      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00420      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00421      +                  (0.0D0,0.0D0), (0.7D0,-0.8D0), (-0.4D0,-0.7D0),
00422      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00423      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.7D0,-0.8D0),
00424      +                  (-0.4D0,-0.7D0), (-0.1D0,-0.9D0),
00425      +                  (0.2D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00426      +                  (0.0D0,0.0D0)/
00427       DATA              ((CT10Y(I,J,2),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00428      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00429      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00430      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00431      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00432      +                  (0.0D0,0.0D0), (-0.1D0,-0.9D0), (-0.9D0,0.5D0),
00433      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00434      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (-0.6D0,0.6D0),
00435      +                  (-0.9D0,0.5D0), (-0.9D0,-0.4D0), (0.1D0,-0.5D0),
00436      +                  (-0.1D0,-0.9D0), (-0.5D0,-0.3D0),
00437      +                  (0.7D0,-0.8D0)/
00438       DATA              ((CT10Y(I,J,3),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00439      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00440      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00441      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00442      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00443      +                  (0.0D0,0.0D0), (-0.1D0,-0.9D0), (0.7D0,-0.8D0),
00444      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00445      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (-0.6D0,0.6D0),
00446      +                  (-0.9D0,-0.4D0), (-0.1D0,-0.9D0),
00447      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00448      +                  (0.0D0,0.0D0)/
00449       DATA              ((CT10Y(I,J,4),I=1,7),J=1,4)/(0.6D0,-0.6D0),
00450      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00451      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00452      +                  (0.7D0,-0.8D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00453      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00454      +                  (0.0D0,0.0D0), (0.7D0,-0.8D0), (-0.9D0,0.5D0),
00455      +                  (-0.4D0,-0.7D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00456      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.7D0,-0.8D0),
00457      +                  (-0.9D0,0.5D0), (-0.4D0,-0.7D0), (0.1D0,-0.5D0),
00458      +                  (-0.1D0,-0.9D0), (-0.5D0,-0.3D0),
00459      +                  (0.2D0,-0.8D0)/
00460       DATA              CSIZE1/(0.0D0,0.0D0), (0.9D0,0.9D0),
00461      +                  (1.63D0,1.73D0), (2.90D0,2.78D0)/
00462       DATA              CSIZE3/(0.0D0,0.0D0), (0.0D0,0.0D0),
00463      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00464      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (1.17D0,1.17D0),
00465      +                  (1.17D0,1.17D0), (1.17D0,1.17D0),
00466      +                  (1.17D0,1.17D0), (1.17D0,1.17D0),
00467      +                  (1.17D0,1.17D0), (1.17D0,1.17D0)/
00468       DATA              CSIZE2/(0.0D0,0.0D0), (0.0D0,0.0D0),
00469      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (0.0D0,0.0D0),
00470      +                  (0.0D0,0.0D0), (0.0D0,0.0D0), (1.54D0,1.54D0),
00471      +                  (1.54D0,1.54D0), (1.54D0,1.54D0),
00472      +                  (1.54D0,1.54D0), (1.54D0,1.54D0),
00473      +                  (1.54D0,1.54D0), (1.54D0,1.54D0)/
00474 *     .. Executable Statements ..
00475       DO 60 KI = 1, 4
00476          INCX = INCXS(KI)
00477          INCY = INCYS(KI)
00478          MX = ABS(INCX)
00479          MY = ABS(INCY)
00480 *
00481          DO 40 KN = 1, 4
00482             N = NS(KN)
00483             KSIZE = MIN(2,KN)
00484             LENX = LENS(KN,MX)
00485             LENY = LENS(KN,MY)
00486 *           .. initialize all argument arrays ..
00487             DO 20 I = 1, 7
00488                CX(I) = CX1(I)
00489                CY(I) = CY1(I)
00490    20       CONTINUE
00491             IF (ICASE.EQ.1) THEN
00492 *              .. ZDOTC ..
00493                CDOT(1) = ZDOTC(N,CX,INCX,CY,INCY)
00494                CALL CTEST(1,CDOT,CT6(KN,KI),CSIZE1(KN),SFAC)
00495             ELSE IF (ICASE.EQ.2) THEN
00496 *              .. ZDOTU ..
00497                CDOT(1) = ZDOTU(N,CX,INCX,CY,INCY)
00498                CALL CTEST(1,CDOT,CT7(KN,KI),CSIZE1(KN),SFAC)
00499             ELSE IF (ICASE.EQ.3) THEN
00500 *              .. ZAXPY ..
00501                CALL ZAXPY(N,CA,CX,INCX,CY,INCY)
00502                CALL CTEST(LENY,CY,CT8(1,KN,KI),CSIZE2(1,KSIZE),SFAC)
00503             ELSE IF (ICASE.EQ.4) THEN
00504 *              .. ZCOPY ..
00505                CALL ZCOPY(N,CX,INCX,CY,INCY)
00506                CALL CTEST(LENY,CY,CT10Y(1,KN,KI),CSIZE3,1.0D0)
00507             ELSE IF (ICASE.EQ.5) THEN
00508 *              .. ZSWAP ..
00509                CALL ZSWAP(N,CX,INCX,CY,INCY)
00510                CALL CTEST(LENX,CX,CT10X(1,KN,KI),CSIZE3,1.0D0)
00511                CALL CTEST(LENY,CY,CT10Y(1,KN,KI),CSIZE3,1.0D0)
00512             ELSE
00513                WRITE (NOUT,*) ' Shouldn''t be here in CHECK2'
00514                STOP
00515             END IF
00516 *
00517    40    CONTINUE
00518    60 CONTINUE
00519       RETURN
00520       END
00521       SUBROUTINE STEST(LEN,SCOMP,STRUE,SSIZE,SFAC)
00522 *     ********************************* STEST **************************
00523 *
00524 *     THIS SUBR COMPARES ARRAYS  SCOMP() AND STRUE() OF LENGTH LEN TO
00525 *     SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE
00526 *     NEGLIGIBLE.
00527 *
00528 *     C. L. LAWSON, JPL, 1974 DEC 10
00529 *
00530 *     .. Parameters ..
00531       INTEGER          NOUT
00532       PARAMETER        (NOUT=6)
00533 *     .. Scalar Arguments ..
00534       DOUBLE PRECISION SFAC
00535       INTEGER          LEN
00536 *     .. Array Arguments ..
00537       DOUBLE PRECISION SCOMP(LEN), SSIZE(LEN), STRUE(LEN)
00538 *     .. Scalars in Common ..
00539       INTEGER          ICASE, INCX, INCY, MODE, N
00540       LOGICAL          PASS
00541 *     .. Local Scalars ..
00542       DOUBLE PRECISION SD
00543       INTEGER          I
00544 *     .. External Functions ..
00545       DOUBLE PRECISION SDIFF
00546       EXTERNAL         SDIFF
00547 *     .. Intrinsic Functions ..
00548       INTRINSIC        ABS
00549 *     .. Common blocks ..
00550       COMMON           /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00551 *     .. Executable Statements ..
00552 *
00553       DO 40 I = 1, LEN
00554          SD = SCOMP(I) - STRUE(I)
00555          IF (SDIFF(ABS(SSIZE(I))+ABS(SFAC*SD),ABS(SSIZE(I))).EQ.0.0D0)
00556      +       GO TO 40
00557 *
00558 *                             HERE    SCOMP(I) IS NOT CLOSE TO STRUE(I).
00559 *
00560          IF ( .NOT. PASS) GO TO 20
00561 *                             PRINT FAIL MESSAGE AND HEADER.
00562          PASS = .FALSE.
00563          WRITE (NOUT,99999)
00564          WRITE (NOUT,99998)
00565    20    WRITE (NOUT,99997) ICASE, N, INCX, INCY, MODE, I, SCOMP(I),
00566      +     STRUE(I), SD, SSIZE(I)
00567    40 CONTINUE
00568       RETURN
00569 *
00570 99999 FORMAT ('                                       FAIL')
00571 99998 FORMAT (/' CASE  N INCX INCY MODE  I                            ',
00572      +       ' COMP(I)                             TRUE(I)  DIFFERENCE',
00573      +       '     SIZE(I)',/1X)
00574 99997 FORMAT (1X,I4,I3,3I5,I3,2D36.8,2D12.4)
00575       END
00576       SUBROUTINE STEST1(SCOMP1,STRUE1,SSIZE,SFAC)
00577 *     ************************* STEST1 *****************************
00578 *
00579 *     THIS IS AN INTERFACE SUBROUTINE TO ACCOMODATE THE FORTRAN
00580 *     REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE
00581 *     ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT.
00582 *
00583 *     C.L. LAWSON, JPL, 1978 DEC 6
00584 *
00585 *     .. Scalar Arguments ..
00586       DOUBLE PRECISION  SCOMP1, SFAC, STRUE1
00587 *     .. Array Arguments ..
00588       DOUBLE PRECISION  SSIZE(*)
00589 *     .. Local Arrays ..
00590       DOUBLE PRECISION  SCOMP(1), STRUE(1)
00591 *     .. External Subroutines ..
00592       EXTERNAL          STEST
00593 *     .. Executable Statements ..
00594 *
00595       SCOMP(1) = SCOMP1
00596       STRUE(1) = STRUE1
00597       CALL STEST(1,SCOMP,STRUE,SSIZE,SFAC)
00598 *
00599       RETURN
00600       END
00601       DOUBLE PRECISION FUNCTION SDIFF(SA,SB)
00602 *     ********************************* SDIFF **************************
00603 *     COMPUTES DIFFERENCE OF TWO NUMBERS.  C. L. LAWSON, JPL 1974 FEB 15
00604 *
00605 *     .. Scalar Arguments ..
00606       DOUBLE PRECISION                SA, SB
00607 *     .. Executable Statements ..
00608       SDIFF = SA - SB
00609       RETURN
00610       END
00611       SUBROUTINE CTEST(LEN,CCOMP,CTRUE,CSIZE,SFAC)
00612 *     **************************** CTEST *****************************
00613 *
00614 *     C.L. LAWSON, JPL, 1978 DEC 6
00615 *
00616 *     .. Scalar Arguments ..
00617       DOUBLE PRECISION SFAC
00618       INTEGER          LEN
00619 *     .. Array Arguments ..
00620       COMPLEX*16       CCOMP(LEN), CSIZE(LEN), CTRUE(LEN)
00621 *     .. Local Scalars ..
00622       INTEGER          I
00623 *     .. Local Arrays ..
00624       DOUBLE PRECISION SCOMP(20), SSIZE(20), STRUE(20)
00625 *     .. External Subroutines ..
00626       EXTERNAL         STEST
00627 *     .. Intrinsic Functions ..
00628       INTRINSIC        DIMAG, DBLE
00629 *     .. Executable Statements ..
00630       DO 20 I = 1, LEN
00631          SCOMP(2*I-1) = DBLE(CCOMP(I))
00632          SCOMP(2*I) = DIMAG(CCOMP(I))
00633          STRUE(2*I-1) = DBLE(CTRUE(I))
00634          STRUE(2*I) = DIMAG(CTRUE(I))
00635          SSIZE(2*I-1) = DBLE(CSIZE(I))
00636          SSIZE(2*I) = DIMAG(CSIZE(I))
00637    20 CONTINUE
00638 *
00639       CALL STEST(2*LEN,SCOMP,STRUE,SSIZE,SFAC)
00640       RETURN
00641       END
00642       SUBROUTINE ITEST1(ICOMP,ITRUE)
00643 *     ********************************* ITEST1 *************************
00644 *
00645 *     THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR
00646 *     EQUALITY.
00647 *     C. L. LAWSON, JPL, 1974 DEC 10
00648 *
00649 *     .. Parameters ..
00650       INTEGER           NOUT
00651       PARAMETER         (NOUT=6)
00652 *     .. Scalar Arguments ..
00653       INTEGER           ICOMP, ITRUE
00654 *     .. Scalars in Common ..
00655       INTEGER           ICASE, INCX, INCY, MODE, N
00656       LOGICAL           PASS
00657 *     .. Local Scalars ..
00658       INTEGER           ID
00659 *     .. Common blocks ..
00660       COMMON            /COMBLA/ICASE, N, INCX, INCY, MODE, PASS
00661 *     .. Executable Statements ..
00662       IF (ICOMP.EQ.ITRUE) GO TO 40
00663 *
00664 *                            HERE ICOMP IS NOT EQUAL TO ITRUE.
00665 *
00666       IF ( .NOT. PASS) GO TO 20
00667 *                             PRINT FAIL MESSAGE AND HEADER.
00668       PASS = .FALSE.
00669       WRITE (NOUT,99999)
00670       WRITE (NOUT,99998)
00671    20 ID = ICOMP - ITRUE
00672       WRITE (NOUT,99997) ICASE, N, INCX, INCY, MODE, ICOMP, ITRUE, ID
00673    40 CONTINUE
00674       RETURN
00675 *
00676 99999 FORMAT ('                                       FAIL')
00677 99998 FORMAT (/' CASE  N INCX INCY MODE                               ',
00678      +       ' COMP                                TRUE     DIFFERENCE',
00679      +       /1X)
00680 99997 FORMAT (1X,I4,I3,3I5,2I36,I12)
00681       END
 All Files Functions