cblat1.c
Go to the documentation of this file.
00001 /* cblat1.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Common Block Declarations */
00017 
00018 struct {
00019     integer icase, n, incx, incy, mode;
00020     logical pass;
00021 } combla_;
00022 
00023 #define combla_1 combla_
00024 
00025 /* Table of constant values */
00026 
00027 static integer c__1 = 1;
00028 static integer c__9 = 9;
00029 static integer c__5 = 5;
00030 static real c_b43 = 1.f;
00031 
00032 /* Main program */ int MAIN__(void)
00033 {
00034     /* Initialized data */
00035 
00036     static real sfac = 9.765625e-4f;
00037 
00038     /* Format strings */
00039     static char fmt_99999[] = "(\002 Complex BLAS Test Program Results\002,/"
00040             "1x)";
00041     static char fmt_99998[] = "(\002                                    ----"
00042             "- PASS -----\002)";
00043 
00044     /* Builtin functions */
00045     integer s_wsfe(cilist *), e_wsfe(void);
00046     /* Subroutine */ int s_stop(char *, ftnlen);
00047 
00048     /* Local variables */
00049     integer ic;
00050     extern /* Subroutine */ int check1_(real *), check2_(real *), header_(
00051             void);
00052 
00053     /* Fortran I/O blocks */
00054     static cilist io___2 = { 0, 6, 0, fmt_99999, 0 };
00055     static cilist io___4 = { 0, 6, 0, fmt_99998, 0 };
00056 
00057 
00058 /*     Test program for the COMPLEX    Level 1 BLAS. */
00059 /*     Based upon the original BLAS test routine together with: */
00060 /*     F06GAF Example Program Text */
00061 /*     .. Parameters .. */
00062 /*     .. Scalars in Common .. */
00063 /*     .. Local Scalars .. */
00064 /*     .. External Subroutines .. */
00065 /*     .. Common blocks .. */
00066 /*     .. Data statements .. */
00067 /*     .. Executable Statements .. */
00068     s_wsfe(&io___2);
00069     e_wsfe();
00070     for (ic = 1; ic <= 10; ++ic) {
00071         combla_1.icase = ic;
00072         header_();
00073 
00074 /*        Initialize PASS, INCX, INCY, and MODE for a new case. */
00075 /*        The value 9999 for INCX, INCY or MODE will appear in the */
00076 /*        detailed  output, if any, for cases that do not involve */
00077 /*        these parameters. */
00078 
00079         combla_1.pass = TRUE_;
00080         combla_1.incx = 9999;
00081         combla_1.incy = 9999;
00082         combla_1.mode = 9999;
00083         if (combla_1.icase <= 5) {
00084             check2_(&sfac);
00085         } else if (combla_1.icase >= 6) {
00086             check1_(&sfac);
00087         }
00088 /*        -- Print */
00089         if (combla_1.pass) {
00090             s_wsfe(&io___4);
00091             e_wsfe();
00092         }
00093 /* L20: */
00094     }
00095     s_stop("", (ftnlen)0);
00096 
00097     return 0;
00098 } /* MAIN__ */
00099 
00100 /* Subroutine */ int header_(void)
00101 {
00102     /* Initialized data */
00103 
00104     static char l[6*10] = "CDOTC " "CDOTU " "CAXPY " "CCOPY " "CSWAP " "SCNR"
00105             "M2" "SCASUM" "CSCAL " "CSSCAL" "ICAMAX";
00106 
00107     /* Format strings */
00108     static char fmt_99999[] = "(/\002 Test of subprogram number\002,i3,12x,a"
00109             "6)";
00110 
00111     /* Builtin functions */
00112     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00113 
00114     /* Fortran I/O blocks */
00115     static cilist io___6 = { 0, 6, 0, fmt_99999, 0 };
00116 
00117 
00118 /*     .. Parameters .. */
00119 /*     .. Scalars in Common .. */
00120 /*     .. Local Arrays .. */
00121 /*     .. Common blocks .. */
00122 /*     .. Data statements .. */
00123 /*     .. Executable Statements .. */
00124     s_wsfe(&io___6);
00125     do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00126     do_fio(&c__1, l + (0 + (0 + (combla_1.icase - 1) * 6)), (ftnlen)6);
00127     e_wsfe();
00128     return 0;
00129 
00130 } /* header_ */
00131 
00132 /* Subroutine */ int check1_(real *sfac)
00133 {
00134     /* Initialized data */
00135 
00136     static real strue2[5] = { 0.f,.5f,.6f,.7f,.8f };
00137     static real strue4[5] = { 0.f,.7f,1.f,1.3f,1.6f };
00138     static complex ctrue5[80]   /* was [8][5][2] */ = { {.1f,.1f},{1.f,2.f},{
00139             1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{-.16f,
00140             -.37f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f}
00141             ,{3.f,4.f},{-.17f,-.19f},{.13f,-.39f},{5.f,6.f},{5.f,6.f},{5.f,
00142             6.f},{5.f,6.f},{5.f,6.f},{5.f,6.f},{.11f,-.03f},{-.17f,.46f},{
00143             -.17f,-.19f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{
00144             .19f,-.17f},{.2f,-.35f},{.35f,.2f},{.14f,.08f},{2.f,3.f},{2.f,3.f}
00145             ,{2.f,3.f},{2.f,3.f},{.1f,.1f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{4.f,
00146             5.f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{-.16f,-.37f},{6.f,7.f},{6.f,
00147             7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{-.17f,
00148             -.19f},{8.f,9.f},{.13f,-.39f},{2.f,5.f},{2.f,5.f},{2.f,5.f},{2.f,
00149             5.f},{2.f,5.f},{.11f,-.03f},{3.f,6.f},{-.17f,.46f},{4.f,7.f},{
00150             -.17f,-.19f},{7.f,2.f},{7.f,2.f},{7.f,2.f},{.19f,-.17f},{5.f,8.f},
00151             {.2f,-.35f},{6.f,9.f},{.35f,.2f},{8.f,3.f},{.14f,.08f},{9.f,4.f} }
00152             ;
00153     static complex ctrue6[80]   /* was [8][5][2] */ = { {.1f,.1f},{1.f,2.f},{
00154             1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{.09f,
00155             -.12f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f}
00156             ,{3.f,4.f},{.03f,-.09f},{.15f,-.03f},{5.f,6.f},{5.f,6.f},{5.f,6.f}
00157             ,{5.f,6.f},{5.f,6.f},{5.f,6.f},{.03f,.03f},{-.18f,.03f},{.03f,
00158             -.09f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{.09f,
00159             .03f},{.15f,0.f},{0.f,.15f},{0.f,.06f},{2.f,3.f},{2.f,3.f},{2.f,
00160             3.f},{2.f,3.f},{.1f,.1f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{
00161             4.f,5.f},{4.f,5.f},{4.f,5.f},{.09f,-.12f},{6.f,7.f},{6.f,7.f},{
00162             6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{.03f,-.09f},{
00163             8.f,9.f},{.15f,-.03f},{2.f,5.f},{2.f,5.f},{2.f,5.f},{2.f,5.f},{
00164             2.f,5.f},{.03f,.03f},{3.f,6.f},{-.18f,.03f},{4.f,7.f},{.03f,-.09f}
00165             ,{7.f,2.f},{7.f,2.f},{7.f,2.f},{.09f,.03f},{5.f,8.f},{.15f,0.f},{
00166             6.f,9.f},{0.f,.15f},{8.f,3.f},{0.f,.06f},{9.f,4.f} };
00167     static integer itrue3[5] = { 0,1,2,2,2 };
00168     static real sa = .3f;
00169     static complex ca = {.4f,-.7f};
00170     static complex cv[80]       /* was [8][5][2] */ = { {.1f,.1f},{1.f,2.f},{
00171             1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{1.f,2.f},{.3f,
00172             -.4f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},{3.f,4.f},
00173             {3.f,4.f},{.1f,-.3f},{.5f,-.1f},{5.f,6.f},{5.f,6.f},{5.f,6.f},{
00174             5.f,6.f},{5.f,6.f},{5.f,6.f},{.1f,.1f},{-.6f,.1f},{.1f,-.3f},{7.f,
00175             8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{7.f,8.f},{.3f,.1f},{.5f,0.f},{
00176             0.f,.5f},{0.f,.2f},{2.f,3.f},{2.f,3.f},{2.f,3.f},{2.f,3.f},{.1f,
00177             .1f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{4.f,5.f},{
00178             4.f,5.f},{.3f,-.4f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,7.f},{6.f,
00179             7.f},{6.f,7.f},{6.f,7.f},{.1f,-.3f},{8.f,9.f},{.5f,-.1f},{2.f,5.f}
00180             ,{2.f,5.f},{2.f,5.f},{2.f,5.f},{2.f,5.f},{.1f,.1f},{3.f,6.f},{
00181             -.6f,.1f},{4.f,7.f},{.1f,-.3f},{7.f,2.f},{7.f,2.f},{7.f,2.f},{.3f,
00182             .1f},{5.f,8.f},{.5f,0.f},{6.f,9.f},{0.f,.5f},{8.f,3.f},{0.f,.2f},{
00183             9.f,4.f} };
00184 
00185     /* System generated locals */
00186     integer i__1, i__2, i__3;
00187     real r__1;
00188     complex q__1;
00189 
00190     /* Builtin functions */
00191     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00192             e_wsle(void);
00193     /* Subroutine */ int s_stop(char *, ftnlen);
00194 
00195     /* Local variables */
00196     integer i__;
00197     complex cx[8];
00198     integer np1, len;
00199     extern /* Subroutine */ int cscal_(integer *, complex *, complex *, 
00200             integer *), ctest_(integer *, complex *, complex *, complex *, 
00201             real *);
00202     complex mwpcs[5], mwpct[5];
00203     extern doublereal scnrm2_(integer *, complex *, integer *);
00204     extern /* Subroutine */ int itest1_(integer *, integer *), stest1_(real *,
00205              real *, real *, real *);
00206     extern integer icamax_(integer *, complex *, integer *);
00207     extern /* Subroutine */ int csscal_(integer *, real *, complex *, integer 
00208             *);
00209     extern doublereal scasum_(integer *, complex *, integer *);
00210 
00211     /* Fortran I/O blocks */
00212     static cilist io___19 = { 0, 6, 0, 0, 0 };
00213 
00214 
00215 /*     .. Parameters .. */
00216 /*     .. Scalar Arguments .. */
00217 /*     .. Scalars in Common .. */
00218 /*     .. Local Scalars .. */
00219 /*     .. Local Arrays .. */
00220 /*     .. External Functions .. */
00221 /*     .. External Subroutines .. */
00222 /*     .. Intrinsic Functions .. */
00223 /*     .. Common blocks .. */
00224 /*     .. Data statements .. */
00225 /*     .. Executable Statements .. */
00226     for (combla_1.incx = 1; combla_1.incx <= 2; ++combla_1.incx) {
00227         for (np1 = 1; np1 <= 5; ++np1) {
00228             combla_1.n = np1 - 1;
00229             len = max(combla_1.n,1) << 1;
00230 /*           .. Set vector arguments .. */
00231             i__1 = len;
00232             for (i__ = 1; i__ <= i__1; ++i__) {
00233                 i__2 = i__ - 1;
00234                 i__3 = i__ + (np1 + combla_1.incx * 5 << 3) - 49;
00235                 cx[i__2].r = cv[i__3].r, cx[i__2].i = cv[i__3].i;
00236 /* L20: */
00237             }
00238             if (combla_1.icase == 6) {
00239 /*              .. SCNRM2 .. */
00240                 r__1 = scnrm2_(&combla_1.n, cx, &combla_1.incx);
00241                 stest1_(&r__1, &strue2[np1 - 1], &strue2[np1 - 1], sfac);
00242             } else if (combla_1.icase == 7) {
00243 /*              .. SCASUM .. */
00244                 r__1 = scasum_(&combla_1.n, cx, &combla_1.incx);
00245                 stest1_(&r__1, &strue4[np1 - 1], &strue4[np1 - 1], sfac);
00246             } else if (combla_1.icase == 8) {
00247 /*              .. CSCAL .. */
00248                 cscal_(&combla_1.n, &ca, cx, &combla_1.incx);
00249                 ctest_(&len, cx, &ctrue5[(np1 + combla_1.incx * 5 << 3) - 48],
00250                          &ctrue5[(np1 + combla_1.incx * 5 << 3) - 48], sfac);
00251             } else if (combla_1.icase == 9) {
00252 /*              .. CSSCAL .. */
00253                 csscal_(&combla_1.n, &sa, cx, &combla_1.incx);
00254                 ctest_(&len, cx, &ctrue6[(np1 + combla_1.incx * 5 << 3) - 48],
00255                          &ctrue6[(np1 + combla_1.incx * 5 << 3) - 48], sfac);
00256             } else if (combla_1.icase == 10) {
00257 /*              .. ICAMAX .. */
00258                 i__1 = icamax_(&combla_1.n, cx, &combla_1.incx);
00259                 itest1_(&i__1, &itrue3[np1 - 1]);
00260             } else {
00261                 s_wsle(&io___19);
00262                 do_lio(&c__9, &c__1, " Shouldn't be here in CHECK1", (ftnlen)
00263                         28);
00264                 e_wsle();
00265                 s_stop("", (ftnlen)0);
00266             }
00267 
00268 /* L40: */
00269         }
00270 /* L60: */
00271     }
00272 
00273     combla_1.incx = 1;
00274     if (combla_1.icase == 8) {
00275 /*        CSCAL */
00276 /*        Add a test for alpha equal to zero. */
00277         ca.r = 0.f, ca.i = 0.f;
00278         for (i__ = 1; i__ <= 5; ++i__) {
00279             i__1 = i__ - 1;
00280             mwpct[i__1].r = 0.f, mwpct[i__1].i = 0.f;
00281             i__1 = i__ - 1;
00282             mwpcs[i__1].r = 1.f, mwpcs[i__1].i = 1.f;
00283 /* L80: */
00284         }
00285         cscal_(&c__5, &ca, cx, &combla_1.incx);
00286         ctest_(&c__5, cx, mwpct, mwpcs, sfac);
00287     } else if (combla_1.icase == 9) {
00288 /*        CSSCAL */
00289 /*        Add a test for alpha equal to zero. */
00290         sa = 0.f;
00291         for (i__ = 1; i__ <= 5; ++i__) {
00292             i__1 = i__ - 1;
00293             mwpct[i__1].r = 0.f, mwpct[i__1].i = 0.f;
00294             i__1 = i__ - 1;
00295             mwpcs[i__1].r = 1.f, mwpcs[i__1].i = 1.f;
00296 /* L100: */
00297         }
00298         csscal_(&c__5, &sa, cx, &combla_1.incx);
00299         ctest_(&c__5, cx, mwpct, mwpcs, sfac);
00300 /*        Add a test for alpha equal to one. */
00301         sa = 1.f;
00302         for (i__ = 1; i__ <= 5; ++i__) {
00303             i__1 = i__ - 1;
00304             i__2 = i__ - 1;
00305             mwpct[i__1].r = cx[i__2].r, mwpct[i__1].i = cx[i__2].i;
00306             i__1 = i__ - 1;
00307             i__2 = i__ - 1;
00308             mwpcs[i__1].r = cx[i__2].r, mwpcs[i__1].i = cx[i__2].i;
00309 /* L120: */
00310         }
00311         csscal_(&c__5, &sa, cx, &combla_1.incx);
00312         ctest_(&c__5, cx, mwpct, mwpcs, sfac);
00313 /*        Add a test for alpha equal to minus one. */
00314         sa = -1.f;
00315         for (i__ = 1; i__ <= 5; ++i__) {
00316             i__1 = i__ - 1;
00317             i__2 = i__ - 1;
00318             q__1.r = -cx[i__2].r, q__1.i = -cx[i__2].i;
00319             mwpct[i__1].r = q__1.r, mwpct[i__1].i = q__1.i;
00320             i__1 = i__ - 1;
00321             i__2 = i__ - 1;
00322             q__1.r = -cx[i__2].r, q__1.i = -cx[i__2].i;
00323             mwpcs[i__1].r = q__1.r, mwpcs[i__1].i = q__1.i;
00324 /* L140: */
00325         }
00326         csscal_(&c__5, &sa, cx, &combla_1.incx);
00327         ctest_(&c__5, cx, mwpct, mwpcs, sfac);
00328     }
00329     return 0;
00330 } /* check1_ */
00331 
00332 /* Subroutine */ int check2_(real *sfac)
00333 {
00334     /* Initialized data */
00335 
00336     static complex ca = {.4f,-.7f};
00337     static integer incxs[4] = { 1,2,-2,-1 };
00338     static integer incys[4] = { 1,-2,1,-2 };
00339     static integer lens[8]      /* was [4][2] */ = { 1,1,2,4,1,1,3,7 };
00340     static integer ns[4] = { 0,1,2,4 };
00341     static complex cx1[7] = { {.7f,-.8f},{-.4f,-.7f},{-.1f,-.9f},{.2f,-.8f},{
00342             -.9f,-.4f},{.1f,.4f},{-.6f,.6f} };
00343     static complex cy1[7] = { {.6f,-.6f},{-.9f,.5f},{.7f,-.6f},{.1f,-.5f},{
00344             -.1f,-.2f},{-.5f,-.3f},{.8f,-.7f} };
00345     static complex ct8[112]     /* was [7][4][4] */ = { {.6f,-.6f},{0.f,0.f},{
00346             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.32f,-1.41f},{
00347             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.32f,
00348             -1.41f},{-1.55f,.5f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00349             0.f},{.32f,-1.41f},{-1.55f,.5f},{.03f,-.89f},{-.38f,-.96f},{0.f,
00350             0.f},{0.f,0.f},{0.f,0.f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00351             {0.f,0.f},{0.f,0.f},{0.f,0.f},{.32f,-1.41f},{0.f,0.f},{0.f,0.f},{
00352             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{-.07f,-.89f},{-.9f,.5f},{
00353             .42f,-1.41f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.78f,.06f},{
00354             -.9f,.5f},{.06f,-.13f},{.1f,-.5f},{-.77f,-.49f},{-.5f,-.3f},{.52f,
00355             -1.51f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00356             0.f},{0.f,0.f},{.32f,-1.41f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00357             0.f},{0.f,0.f},{0.f,0.f},{-.07f,-.89f},{-1.18f,-.31f},{0.f,0.f},{
00358             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.78f,.06f},{-1.54f,.97f},{
00359             .03f,-.89f},{-.18f,-1.31f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,
00360             -.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00361             {.32f,-1.41f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{
00362             0.f,0.f},{.32f,-1.41f},{-.9f,.5f},{.05f,-.6f},{0.f,0.f},{0.f,0.f},
00363             {0.f,0.f},{0.f,0.f},{.32f,-1.41f},{-.9f,.5f},{.05f,-.6f},{.1f,
00364             -.5f},{-.77f,-.49f},{-.5f,-.3f},{.32f,-1.16f} };
00365     static complex ct7[16]      /* was [4][4] */ = { {0.f,0.f},{-.06f,-.9f},{
00366             .65f,-.47f},{-.34f,-1.22f},{0.f,0.f},{-.06f,-.9f},{-.59f,-1.46f},{
00367             -1.04f,-.04f},{0.f,0.f},{-.06f,-.9f},{-.83f,.59f},{.07f,-.37f},{
00368             0.f,0.f},{-.06f,-.9f},{-.76f,-1.15f},{-1.33f,-1.82f} };
00369     static complex ct6[16]      /* was [4][4] */ = { {0.f,0.f},{.9f,.06f},{
00370             .91f,-.77f},{1.8f,-.1f},{0.f,0.f},{.9f,.06f},{1.45f,.74f},{.2f,
00371             .9f},{0.f,0.f},{.9f,.06f},{-.55f,.23f},{.83f,-.39f},{0.f,0.f},{
00372             .9f,.06f},{1.04f,.79f},{1.95f,1.22f} };
00373     static complex ct10x[112]   /* was [7][4][4] */ = { {.7f,-.8f},{0.f,0.f},{
00374             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,-.6f},{0.f,
00375             0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,-.6f},
00376             {-.9f,.5f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,
00377             -.6f},{-.9f,.5f},{.7f,-.6f},{.1f,-.5f},{0.f,0.f},{0.f,0.f},{0.f,
00378             0.f},{.7f,-.8f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00379             {0.f,0.f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00380             0.f},{0.f,0.f},{.7f,-.6f},{-.4f,-.7f},{.6f,-.6f},{0.f,0.f},{0.f,
00381             0.f},{0.f,0.f},{0.f,0.f},{.8f,-.7f},{-.4f,-.7f},{-.1f,-.2f},{.2f,
00382             -.8f},{.7f,-.6f},{.1f,.4f},{.6f,-.6f},{.7f,-.8f},{0.f,0.f},{0.f,
00383             0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,-.6f},{0.f,0.f},
00384             {0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{-.9f,.5f},{
00385             -.4f,-.7f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{
00386             .1f,-.5f},{-.4f,-.7f},{.7f,-.6f},{.2f,-.8f},{-.9f,.5f},{.1f,.4f},{
00387             .6f,-.6f},{.7f,-.8f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00388             0.f},{0.f,0.f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00389             {0.f,0.f},{0.f,0.f},{.6f,-.6f},{.7f,-.6f},{0.f,0.f},{0.f,0.f},{
00390             0.f,0.f},{0.f,0.f},{0.f,0.f},{.6f,-.6f},{.7f,-.6f},{-.1f,-.2f},{
00391             .8f,-.7f},{0.f,0.f},{0.f,0.f},{0.f,0.f} };
00392     static complex ct10y[112]   /* was [7][4][4] */ = { {.6f,-.6f},{0.f,0.f},{
00393             0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.7f,-.8f},{0.f,
00394             0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.7f,-.8f},
00395             {-.4f,-.7f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{
00396             .7f,-.8f},{-.4f,-.7f},{-.1f,-.9f},{.2f,-.8f},{0.f,0.f},{0.f,0.f},{
00397             0.f,0.f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00398             0.f},{0.f,0.f},{.7f,-.8f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00399             {0.f,0.f},{0.f,0.f},{-.1f,-.9f},{-.9f,.5f},{.7f,-.8f},{0.f,0.f},{
00400             0.f,0.f},{0.f,0.f},{0.f,0.f},{-.6f,.6f},{-.9f,.5f},{-.9f,-.4f},{
00401             .1f,-.5f},{-.1f,-.9f},{-.5f,-.3f},{.7f,-.8f},{.6f,-.6f},{0.f,0.f},
00402             {0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{.7f,-.8f},{0.f,
00403             0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{-.1f,-.9f}
00404             ,{.7f,-.8f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{
00405             -.6f,.6f},{-.9f,-.4f},{-.1f,-.9f},{.7f,-.8f},{0.f,0.f},{0.f,0.f},{
00406             0.f,0.f},{.6f,-.6f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,
00407             0.f},{0.f,0.f},{.7f,-.8f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},
00408             {0.f,0.f},{0.f,0.f},{.7f,-.8f},{-.9f,.5f},{-.4f,-.7f},{0.f,0.f},{
00409             0.f,0.f},{0.f,0.f},{0.f,0.f},{.7f,-.8f},{-.9f,.5f},{-.4f,-.7f},{
00410             .1f,-.5f},{-.1f,-.9f},{-.5f,-.3f},{.2f,-.8f} };
00411     static complex csize1[4] = { {0.f,0.f},{.9f,.9f},{1.63f,1.73f},{2.9f,
00412             2.78f} };
00413     static complex csize3[14] = { {0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{
00414             0.f,0.f},{0.f,0.f},{0.f,0.f},{1.17f,1.17f},{1.17f,1.17f},{1.17f,
00415             1.17f},{1.17f,1.17f},{1.17f,1.17f},{1.17f,1.17f},{1.17f,1.17f} };
00416     static complex csize2[14]   /* was [7][2] */ = { {0.f,0.f},{0.f,0.f},{0.f,
00417             0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{0.f,0.f},{1.54f,1.54f},{1.54f,
00418             1.54f},{1.54f,1.54f},{1.54f,1.54f},{1.54f,1.54f},{1.54f,1.54f},{
00419             1.54f,1.54f} };
00420 
00421     /* System generated locals */
00422     integer i__1, i__2;
00423     complex q__1;
00424 
00425     /* Builtin functions */
00426     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00427             e_wsle(void);
00428     /* Subroutine */ int s_stop(char *, ftnlen);
00429 
00430     /* Local variables */
00431     integer i__, ki, kn;
00432     complex cx[7], cy[7];
00433     integer mx, my;
00434     complex cdot[1];
00435     integer lenx, leny;
00436     extern /* Complex */ VOID cdotc_(complex *, integer *, complex *, integer 
00437             *, complex *, integer *);
00438     extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, 
00439             complex *, integer *);
00440     extern /* Complex */ VOID cdotu_(complex *, integer *, complex *, integer 
00441             *, complex *, integer *);
00442     extern /* Subroutine */ int cswap_(integer *, complex *, integer *, 
00443             complex *, integer *), ctest_(integer *, complex *, complex *, 
00444             complex *, real *);
00445     integer ksize;
00446     extern /* Subroutine */ int caxpy_(integer *, complex *, complex *, 
00447             integer *, complex *, integer *);
00448 
00449     /* Fortran I/O blocks */
00450     static cilist io___48 = { 0, 6, 0, 0, 0 };
00451 
00452 
00453 /*     .. Parameters .. */
00454 /*     .. Scalar Arguments .. */
00455 /*     .. Scalars in Common .. */
00456 /*     .. Local Scalars .. */
00457 /*     .. Local Arrays .. */
00458 /*     .. External Functions .. */
00459 /*     .. External Subroutines .. */
00460 /*     .. Intrinsic Functions .. */
00461 /*     .. Common blocks .. */
00462 /*     .. Data statements .. */
00463 /*     .. Executable Statements .. */
00464     for (ki = 1; ki <= 4; ++ki) {
00465         combla_1.incx = incxs[ki - 1];
00466         combla_1.incy = incys[ki - 1];
00467         mx = abs(combla_1.incx);
00468         my = abs(combla_1.incy);
00469 
00470         for (kn = 1; kn <= 4; ++kn) {
00471             combla_1.n = ns[kn - 1];
00472             ksize = min(2,kn);
00473             lenx = lens[kn + (mx << 2) - 5];
00474             leny = lens[kn + (my << 2) - 5];
00475 /*           .. initialize all argument arrays .. */
00476             for (i__ = 1; i__ <= 7; ++i__) {
00477                 i__1 = i__ - 1;
00478                 i__2 = i__ - 1;
00479                 cx[i__1].r = cx1[i__2].r, cx[i__1].i = cx1[i__2].i;
00480                 i__1 = i__ - 1;
00481                 i__2 = i__ - 1;
00482                 cy[i__1].r = cy1[i__2].r, cy[i__1].i = cy1[i__2].i;
00483 /* L20: */
00484             }
00485             if (combla_1.icase == 1) {
00486 /*              .. CDOTC .. */
00487                 cdotc_(&q__1, &combla_1.n, cx, &combla_1.incx, cy, &
00488                         combla_1.incy);
00489                 cdot[0].r = q__1.r, cdot[0].i = q__1.i;
00490                 ctest_(&c__1, cdot, &ct6[kn + (ki << 2) - 5], &csize1[kn - 1],
00491                          sfac);
00492             } else if (combla_1.icase == 2) {
00493 /*              .. CDOTU .. */
00494                 cdotu_(&q__1, &combla_1.n, cx, &combla_1.incx, cy, &
00495                         combla_1.incy);
00496                 cdot[0].r = q__1.r, cdot[0].i = q__1.i;
00497                 ctest_(&c__1, cdot, &ct7[kn + (ki << 2) - 5], &csize1[kn - 1],
00498                          sfac);
00499             } else if (combla_1.icase == 3) {
00500 /*              .. CAXPY .. */
00501                 caxpy_(&combla_1.n, &ca, cx, &combla_1.incx, cy, &
00502                         combla_1.incy);
00503                 ctest_(&leny, cy, &ct8[(kn + (ki << 2)) * 7 - 35], &csize2[
00504                         ksize * 7 - 7], sfac);
00505             } else if (combla_1.icase == 4) {
00506 /*              .. CCOPY .. */
00507                 ccopy_(&combla_1.n, cx, &combla_1.incx, cy, &combla_1.incy);
00508                 ctest_(&leny, cy, &ct10y[(kn + (ki << 2)) * 7 - 35], csize3, &
00509                         c_b43);
00510             } else if (combla_1.icase == 5) {
00511 /*              .. CSWAP .. */
00512                 cswap_(&combla_1.n, cx, &combla_1.incx, cy, &combla_1.incy);
00513                 ctest_(&lenx, cx, &ct10x[(kn + (ki << 2)) * 7 - 35], csize3, &
00514                         c_b43);
00515                 ctest_(&leny, cy, &ct10y[(kn + (ki << 2)) * 7 - 35], csize3, &
00516                         c_b43);
00517             } else {
00518                 s_wsle(&io___48);
00519                 do_lio(&c__9, &c__1, " Shouldn't be here in CHECK2", (ftnlen)
00520                         28);
00521                 e_wsle();
00522                 s_stop("", (ftnlen)0);
00523             }
00524 
00525 /* L40: */
00526         }
00527 /* L60: */
00528     }
00529     return 0;
00530 } /* check2_ */
00531 
00532 /* Subroutine */ int stest_(integer *len, real *scomp, real *strue, real *
00533         ssize, real *sfac)
00534 {
00535     /* Format strings */
00536     static char fmt_99999[] = "(\002                                       F"
00537             "AIL\002)";
00538     static char fmt_99998[] = "(/\002 CASE  N INCX INCY MODE  I             "
00539             "               \002,\002 COMP(I)                             TRU"
00540             "E(I)  DIFFERENCE\002,\002     SIZE(I)\002,/1x)";
00541     static char fmt_99997[] = "(1x,i4,i3,3i5,i3,2e36.8,2e12.4)";
00542 
00543     /* System generated locals */
00544     integer i__1;
00545     real r__1, r__2, r__3, r__4, r__5;
00546 
00547     /* Builtin functions */
00548     integer s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, char *, ftnlen);
00549 
00550     /* Local variables */
00551     integer i__;
00552     real sd;
00553     extern doublereal sdiff_(real *, real *);
00554 
00555     /* Fortran I/O blocks */
00556     static cilist io___51 = { 0, 6, 0, fmt_99999, 0 };
00557     static cilist io___52 = { 0, 6, 0, fmt_99998, 0 };
00558     static cilist io___53 = { 0, 6, 0, fmt_99997, 0 };
00559 
00560 
00561 /*     ********************************* STEST ************************** */
00562 
00563 /*     THIS SUBR COMPARES ARRAYS  SCOMP() AND STRUE() OF LENGTH LEN TO */
00564 /*     SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE */
00565 /*     NEGLIGIBLE. */
00566 
00567 /*     C. L. LAWSON, JPL, 1974 DEC 10 */
00568 
00569 /*     .. Parameters .. */
00570 /*     .. Scalar Arguments .. */
00571 /*     .. Array Arguments .. */
00572 /*     .. Scalars in Common .. */
00573 /*     .. Local Scalars .. */
00574 /*     .. External Functions .. */
00575 /*     .. Intrinsic Functions .. */
00576 /*     .. Common blocks .. */
00577 /*     .. Executable Statements .. */
00578 
00579     /* Parameter adjustments */
00580     --ssize;
00581     --strue;
00582     --scomp;
00583 
00584     /* Function Body */
00585     i__1 = *len;
00586     for (i__ = 1; i__ <= i__1; ++i__) {
00587         sd = scomp[i__] - strue[i__];
00588         r__4 = (r__1 = ssize[i__], dabs(r__1)) + (r__2 = *sfac * sd, dabs(
00589                 r__2));
00590         r__5 = (r__3 = ssize[i__], dabs(r__3));
00591         if (sdiff_(&r__4, &r__5) == 0.f) {
00592             goto L40;
00593         }
00594 
00595 /*                             HERE    SCOMP(I) IS NOT CLOSE TO STRUE(I). */
00596 
00597         if (! combla_1.pass) {
00598             goto L20;
00599         }
00600 /*                             PRINT FAIL MESSAGE AND HEADER. */
00601         combla_1.pass = FALSE_;
00602         s_wsfe(&io___51);
00603         e_wsfe();
00604         s_wsfe(&io___52);
00605         e_wsfe();
00606 L20:
00607         s_wsfe(&io___53);
00608         do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00609         do_fio(&c__1, (char *)&combla_1.n, (ftnlen)sizeof(integer));
00610         do_fio(&c__1, (char *)&combla_1.incx, (ftnlen)sizeof(integer));
00611         do_fio(&c__1, (char *)&combla_1.incy, (ftnlen)sizeof(integer));
00612         do_fio(&c__1, (char *)&combla_1.mode, (ftnlen)sizeof(integer));
00613         do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
00614         do_fio(&c__1, (char *)&scomp[i__], (ftnlen)sizeof(real));
00615         do_fio(&c__1, (char *)&strue[i__], (ftnlen)sizeof(real));
00616         do_fio(&c__1, (char *)&sd, (ftnlen)sizeof(real));
00617         do_fio(&c__1, (char *)&ssize[i__], (ftnlen)sizeof(real));
00618         e_wsfe();
00619 L40:
00620         ;
00621     }
00622     return 0;
00623 
00624 } /* stest_ */
00625 
00626 /* Subroutine */ int stest1_(real *scomp1, real *strue1, real *ssize, real *
00627         sfac)
00628 {
00629     real scomp[1], strue[1];
00630     extern /* Subroutine */ int stest_(integer *, real *, real *, real *, 
00631             real *);
00632 
00633 /*     ************************* STEST1 ***************************** */
00634 
00635 /*     THIS IS AN INTERFACE SUBROUTINE TO ACCOMODATE THE FORTRAN */
00636 /*     REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE */
00637 /*     ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT. */
00638 
00639 /*     C.L. LAWSON, JPL, 1978 DEC 6 */
00640 
00641 /*     .. Scalar Arguments .. */
00642 /*     .. Array Arguments .. */
00643 /*     .. Local Arrays .. */
00644 /*     .. External Subroutines .. */
00645 /*     .. Executable Statements .. */
00646 
00647     /* Parameter adjustments */
00648     --ssize;
00649 
00650     /* Function Body */
00651     scomp[0] = *scomp1;
00652     strue[0] = *strue1;
00653     stest_(&c__1, scomp, strue, &ssize[1], sfac);
00654 
00655     return 0;
00656 } /* stest1_ */
00657 
00658 doublereal sdiff_(real *sa, real *sb)
00659 {
00660     /* System generated locals */
00661     real ret_val;
00662 
00663 /*     ********************************* SDIFF ************************** */
00664 /*     COMPUTES DIFFERENCE OF TWO NUMBERS.  C. L. LAWSON, JPL 1974 FEB 15 */
00665 
00666 /*     .. Scalar Arguments .. */
00667 /*     .. Executable Statements .. */
00668     ret_val = *sa - *sb;
00669     return ret_val;
00670 } /* sdiff_ */
00671 
00672 /* Subroutine */ int ctest_(integer *len, complex *ccomp, complex *ctrue, 
00673         complex *csize, real *sfac)
00674 {
00675     /* System generated locals */
00676     integer i__1, i__2;
00677 
00678     /* Builtin functions */
00679     double r_imag(complex *);
00680 
00681     /* Local variables */
00682     integer i__;
00683     real scomp[20], ssize[20], strue[20];
00684     extern /* Subroutine */ int stest_(integer *, real *, real *, real *, 
00685             real *);
00686 
00687 /*     **************************** CTEST ***************************** */
00688 
00689 /*     C.L. LAWSON, JPL, 1978 DEC 6 */
00690 
00691 /*     .. Scalar Arguments .. */
00692 /*     .. Array Arguments .. */
00693 /*     .. Local Scalars .. */
00694 /*     .. Local Arrays .. */
00695 /*     .. External Subroutines .. */
00696 /*     .. Intrinsic Functions .. */
00697 /*     .. Executable Statements .. */
00698     /* Parameter adjustments */
00699     --csize;
00700     --ctrue;
00701     --ccomp;
00702 
00703     /* Function Body */
00704     i__1 = *len;
00705     for (i__ = 1; i__ <= i__1; ++i__) {
00706         i__2 = i__;
00707         scomp[(i__ << 1) - 2] = ccomp[i__2].r;
00708         scomp[(i__ << 1) - 1] = r_imag(&ccomp[i__]);
00709         i__2 = i__;
00710         strue[(i__ << 1) - 2] = ctrue[i__2].r;
00711         strue[(i__ << 1) - 1] = r_imag(&ctrue[i__]);
00712         i__2 = i__;
00713         ssize[(i__ << 1) - 2] = csize[i__2].r;
00714         ssize[(i__ << 1) - 1] = r_imag(&csize[i__]);
00715 /* L20: */
00716     }
00717 
00718     i__1 = *len << 1;
00719     stest_(&i__1, scomp, strue, ssize, sfac);
00720     return 0;
00721 } /* ctest_ */
00722 
00723 /* Subroutine */ int itest1_(integer *icomp, integer *itrue)
00724 {
00725     /* Format strings */
00726     static char fmt_99999[] = "(\002                                       F"
00727             "AIL\002)";
00728     static char fmt_99998[] = "(/\002 CASE  N INCX INCY MODE                "
00729             "               \002,\002 COMP                                TRU"
00730             "E     DIFFERENCE\002,/1x)";
00731     static char fmt_99997[] = "(1x,i4,i3,3i5,2i36,i12)";
00732 
00733     /* Builtin functions */
00734     integer s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, char *, ftnlen);
00735 
00736     /* Local variables */
00737     integer id;
00738 
00739     /* Fortran I/O blocks */
00740     static cilist io___60 = { 0, 6, 0, fmt_99999, 0 };
00741     static cilist io___61 = { 0, 6, 0, fmt_99998, 0 };
00742     static cilist io___63 = { 0, 6, 0, fmt_99997, 0 };
00743 
00744 
00745 /*     ********************************* ITEST1 ************************* */
00746 
00747 /*     THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR */
00748 /*     EQUALITY. */
00749 /*     C. L. LAWSON, JPL, 1974 DEC 10 */
00750 
00751 /*     .. Parameters .. */
00752 /*     .. Scalar Arguments .. */
00753 /*     .. Scalars in Common .. */
00754 /*     .. Local Scalars .. */
00755 /*     .. Common blocks .. */
00756 /*     .. Executable Statements .. */
00757     if (*icomp == *itrue) {
00758         goto L40;
00759     }
00760 
00761 /*                            HERE ICOMP IS NOT EQUAL TO ITRUE. */
00762 
00763     if (! combla_1.pass) {
00764         goto L20;
00765     }
00766 /*                             PRINT FAIL MESSAGE AND HEADER. */
00767     combla_1.pass = FALSE_;
00768     s_wsfe(&io___60);
00769     e_wsfe();
00770     s_wsfe(&io___61);
00771     e_wsfe();
00772 L20:
00773     id = *icomp - *itrue;
00774     s_wsfe(&io___63);
00775     do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00776     do_fio(&c__1, (char *)&combla_1.n, (ftnlen)sizeof(integer));
00777     do_fio(&c__1, (char *)&combla_1.incx, (ftnlen)sizeof(integer));
00778     do_fio(&c__1, (char *)&combla_1.incy, (ftnlen)sizeof(integer));
00779     do_fio(&c__1, (char *)&combla_1.mode, (ftnlen)sizeof(integer));
00780     do_fio(&c__1, (char *)&(*icomp), (ftnlen)sizeof(integer));
00781     do_fio(&c__1, (char *)&(*itrue), (ftnlen)sizeof(integer));
00782     do_fio(&c__1, (char *)&id, (ftnlen)sizeof(integer));
00783     e_wsfe();
00784 L40:
00785     return 0;
00786 
00787 } /* itest1_ */
00788 
00789 /* Main program alias */ int cblat1_ () { MAIN__ (); return 0; }


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:16