sblat1.c
Go to the documentation of this file.
00001 /* sblat1.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 real c_b34 = 1.f;
00030 static integer c__5 = 5;
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 Real BLAS Test Program Results\002,/1x)";
00040     static char fmt_99998[] = "(\002                                    ----"
00041             "- PASS -----\002)";
00042 
00043     /* Builtin functions */
00044     integer s_wsfe(cilist *), e_wsfe(void);
00045     /* Subroutine */ int s_stop(char *, ftnlen);
00046 
00047     /* Local variables */
00048     integer ic;
00049     extern /* Subroutine */ int check0_(real *), check1_(real *), check2_(
00050             real *), check3_(real *), header_(void);
00051 
00052     /* Fortran I/O blocks */
00053     static cilist io___2 = { 0, 6, 0, fmt_99999, 0 };
00054     static cilist io___4 = { 0, 6, 0, fmt_99998, 0 };
00055 
00056 
00057 /*     Test program for the REAL             Level 1 BLAS. */
00058 /*     Based upon the original BLAS test routine together with: */
00059 /*     F06EAF Example Program Text */
00060 /*     .. Parameters .. */
00061 /*     .. Scalars in Common .. */
00062 /*     .. Local Scalars .. */
00063 /*     .. External Subroutines .. */
00064 /*     .. Common blocks .. */
00065 /*     .. Data statements .. */
00066 /*     .. Executable Statements .. */
00067     s_wsfe(&io___2);
00068     e_wsfe();
00069     for (ic = 1; ic <= 10; ++ic) {
00070         combla_1.icase = ic;
00071         header_();
00072 
00073 /*        .. Initialize  PASS,  INCX,  INCY, and MODE for a new case. .. */
00074 /*        .. the value 9999 for INCX, INCY or MODE will appear in the .. */
00075 /*        .. detailed  output, if any, for cases  that do not involve .. */
00076 /*        .. these parameters .. */
00077 
00078         combla_1.pass = TRUE_;
00079         combla_1.incx = 9999;
00080         combla_1.incy = 9999;
00081         combla_1.mode = 9999;
00082         if (combla_1.icase == 3) {
00083             check0_(&sfac);
00084         } else if (combla_1.icase == 7 || combla_1.icase == 8 || 
00085                 combla_1.icase == 9 || combla_1.icase == 10) {
00086             check1_(&sfac);
00087         } else if (combla_1.icase == 1 || combla_1.icase == 2 || 
00088                 combla_1.icase == 5 || combla_1.icase == 6) {
00089             check2_(&sfac);
00090         } else if (combla_1.icase == 4) {
00091             check3_(&sfac);
00092         }
00093 /*        -- Print */
00094         if (combla_1.pass) {
00095             s_wsfe(&io___4);
00096             e_wsfe();
00097         }
00098 /* L20: */
00099     }
00100     s_stop("", (ftnlen)0);
00101 
00102     return 0;
00103 } /* MAIN__ */
00104 
00105 /* Subroutine */ int header_(void)
00106 {
00107     /* Initialized data */
00108 
00109     static char l[6*10] = " SDOT " "SAXPY " "SROTG " " SROT " "SCOPY " "SSWA"
00110             "P " "SNRM2 " "SASUM " "SSCAL " "ISAMAX";
00111 
00112     /* Format strings */
00113     static char fmt_99999[] = "(/\002 Test of subprogram number\002,i3,12x,a"
00114             "6)";
00115 
00116     /* Builtin functions */
00117     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00118 
00119     /* Fortran I/O blocks */
00120     static cilist io___6 = { 0, 6, 0, fmt_99999, 0 };
00121 
00122 
00123 /*     .. Parameters .. */
00124 /*     .. Scalars in Common .. */
00125 /*     .. Local Arrays .. */
00126 /*     .. Common blocks .. */
00127 /*     .. Data statements .. */
00128 /*     .. Executable Statements .. */
00129     s_wsfe(&io___6);
00130     do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00131     do_fio(&c__1, l + (0 + (0 + (combla_1.icase - 1) * 6)), (ftnlen)6);
00132     e_wsfe();
00133     return 0;
00134 
00135 } /* header_ */
00136 
00137 /* Subroutine */ int check0_(real *sfac)
00138 {
00139     /* Initialized data */
00140 
00141     static real ds1[8] = { .8f,.6f,.8f,-.6f,.8f,0.f,1.f,0.f };
00142     static real datrue[8] = { .5f,.5f,.5f,-.5f,-.5f,0.f,1.f,1.f };
00143     static real dbtrue[8] = { 0.f,.6f,0.f,-.6f,0.f,0.f,1.f,0.f };
00144     static real da1[8] = { .3f,.4f,-.3f,-.4f,-.3f,0.f,0.f,1.f };
00145     static real db1[8] = { .4f,.3f,.4f,.3f,-.4f,0.f,1.f,0.f };
00146     static real dc1[8] = { .6f,.8f,-.6f,.8f,.6f,1.f,0.f,1.f };
00147 
00148     /* Builtin functions */
00149     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00150             e_wsle(void);
00151     /* Subroutine */ int s_stop(char *, ftnlen);
00152 
00153     /* Local variables */
00154     integer k;
00155     real sa, sb, sc, ss;
00156     extern /* Subroutine */ int srotg_(real *, real *, real *, real *), 
00157             stest1_(real *, real *, real *, real *);
00158 
00159     /* Fortran I/O blocks */
00160     static cilist io___18 = { 0, 6, 0, 0, 0 };
00161 
00162 
00163 /*     .. Parameters .. */
00164 /*     .. Scalar Arguments .. */
00165 /*     .. Scalars in Common .. */
00166 /*     .. Local Scalars .. */
00167 /*     .. Local Arrays .. */
00168 /*     .. External Subroutines .. */
00169 /*     .. Common blocks .. */
00170 /*     .. Data statements .. */
00171 /*     .. Executable Statements .. */
00172 
00173 /*     Compute true values which cannot be prestored */
00174 /*     in decimal notation */
00175 
00176     dbtrue[0] = 1.6666666666666667f;
00177     dbtrue[2] = -1.6666666666666667f;
00178     dbtrue[4] = 1.6666666666666667f;
00179 
00180     for (k = 1; k <= 8; ++k) {
00181 /*        .. Set N=K for identification in output if any .. */
00182         combla_1.n = k;
00183         if (combla_1.icase == 3) {
00184 /*           .. SROTG .. */
00185             if (k > 8) {
00186                 goto L40;
00187             }
00188             sa = da1[k - 1];
00189             sb = db1[k - 1];
00190             srotg_(&sa, &sb, &sc, &ss);
00191             stest1_(&sa, &datrue[k - 1], &datrue[k - 1], sfac);
00192             stest1_(&sb, &dbtrue[k - 1], &dbtrue[k - 1], sfac);
00193             stest1_(&sc, &dc1[k - 1], &dc1[k - 1], sfac);
00194             stest1_(&ss, &ds1[k - 1], &ds1[k - 1], sfac);
00195         } else {
00196             s_wsle(&io___18);
00197             do_lio(&c__9, &c__1, " Shouldn't be here in CHECK0", (ftnlen)28);
00198             e_wsle();
00199             s_stop("", (ftnlen)0);
00200         }
00201 /* L20: */
00202     }
00203 L40:
00204     return 0;
00205 } /* check0_ */
00206 
00207 /* Subroutine */ int check1_(real *sfac)
00208 {
00209     /* Initialized data */
00210 
00211     static real sa[10] = { .3f,-1.f,0.f,1.f,.3f,.3f,.3f,.3f,.3f,.3f };
00212     static real dv[80]  /* was [8][5][2] */ = { .1f,2.f,2.f,2.f,2.f,2.f,2.f,
00213             2.f,.3f,3.f,3.f,3.f,3.f,3.f,3.f,3.f,.3f,-.4f,4.f,4.f,4.f,4.f,4.f,
00214             4.f,.2f,-.6f,.3f,5.f,5.f,5.f,5.f,5.f,.1f,-.3f,.5f,-.1f,6.f,6.f,
00215             6.f,6.f,.1f,8.f,8.f,8.f,8.f,8.f,8.f,8.f,.3f,9.f,9.f,9.f,9.f,9.f,
00216             9.f,9.f,.3f,2.f,-.4f,2.f,2.f,2.f,2.f,2.f,.2f,3.f,-.6f,5.f,.3f,2.f,
00217             2.f,2.f,.1f,4.f,-.3f,6.f,-.5f,7.f,-.1f,3.f };
00218     static real dtrue1[5] = { 0.f,.3f,.5f,.7f,.6f };
00219     static real dtrue3[5] = { 0.f,.3f,.7f,1.1f,1.f };
00220     static real dtrue5[80]      /* was [8][5][2] */ = { .1f,2.f,2.f,2.f,2.f,
00221             2.f,2.f,2.f,-.3f,3.f,3.f,3.f,3.f,3.f,3.f,3.f,0.f,0.f,4.f,4.f,4.f,
00222             4.f,4.f,4.f,.2f,-.6f,.3f,5.f,5.f,5.f,5.f,5.f,.03f,-.09f,.15f,
00223             -.03f,6.f,6.f,6.f,6.f,.1f,8.f,8.f,8.f,8.f,8.f,8.f,8.f,.09f,9.f,
00224             9.f,9.f,9.f,9.f,9.f,9.f,.09f,2.f,-.12f,2.f,2.f,2.f,2.f,2.f,.06f,
00225             3.f,-.18f,5.f,.09f,2.f,2.f,2.f,.03f,4.f,-.09f,6.f,-.15f,7.f,-.03f,
00226             3.f };
00227     static integer itrue2[5] = { 0,1,2,2,3 };
00228 
00229     /* System generated locals */
00230     integer i__1;
00231     real r__1;
00232 
00233     /* Builtin functions */
00234     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00235             e_wsle(void);
00236     /* Subroutine */ int s_stop(char *, ftnlen);
00237 
00238     /* Local variables */
00239     integer i__;
00240     real sx[8];
00241     integer np1, len;
00242     extern doublereal snrm2_(integer *, real *, integer *);
00243     extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *);
00244     real stemp[1];
00245     extern doublereal sasum_(integer *, real *, integer *);
00246     real strue[8];
00247     extern /* Subroutine */ int stest_(integer *, real *, real *, real *, 
00248             real *), itest1_(integer *, integer *), stest1_(real *, real *, 
00249             real *, real *);
00250     extern integer isamax_(integer *, real *, integer *);
00251 
00252     /* Fortran I/O blocks */
00253     static cilist io___31 = { 0, 6, 0, 0, 0 };
00254 
00255 
00256 /*     .. Parameters .. */
00257 /*     .. Scalar Arguments .. */
00258 /*     .. Scalars in Common .. */
00259 /*     .. Local Scalars .. */
00260 /*     .. Local Arrays .. */
00261 /*     .. External Functions .. */
00262 /*     .. External Subroutines .. */
00263 /*     .. Intrinsic Functions .. */
00264 /*     .. Common blocks .. */
00265 /*     .. Data statements .. */
00266 /*     .. Executable Statements .. */
00267     for (combla_1.incx = 1; combla_1.incx <= 2; ++combla_1.incx) {
00268         for (np1 = 1; np1 <= 5; ++np1) {
00269             combla_1.n = np1 - 1;
00270             len = max(combla_1.n,1) << 1;
00271 /*           .. Set vector arguments .. */
00272             i__1 = len;
00273             for (i__ = 1; i__ <= i__1; ++i__) {
00274                 sx[i__ - 1] = dv[i__ + (np1 + combla_1.incx * 5 << 3) - 49];
00275 /* L20: */
00276             }
00277 
00278             if (combla_1.icase == 7) {
00279 /*              .. SNRM2 .. */
00280                 stemp[0] = dtrue1[np1 - 1];
00281                 r__1 = snrm2_(&combla_1.n, sx, &combla_1.incx);
00282                 stest1_(&r__1, stemp, stemp, sfac);
00283             } else if (combla_1.icase == 8) {
00284 /*              .. SASUM .. */
00285                 stemp[0] = dtrue3[np1 - 1];
00286                 r__1 = sasum_(&combla_1.n, sx, &combla_1.incx);
00287                 stest1_(&r__1, stemp, stemp, sfac);
00288             } else if (combla_1.icase == 9) {
00289 /*              .. SSCAL .. */
00290                 sscal_(&combla_1.n, &sa[(combla_1.incx - 1) * 5 + np1 - 1], 
00291                         sx, &combla_1.incx);
00292                 i__1 = len;
00293                 for (i__ = 1; i__ <= i__1; ++i__) {
00294                     strue[i__ - 1] = dtrue5[i__ + (np1 + combla_1.incx * 5 << 
00295                             3) - 49];
00296 /* L40: */
00297                 }
00298                 stest_(&len, sx, strue, strue, sfac);
00299             } else if (combla_1.icase == 10) {
00300 /*              .. ISAMAX .. */
00301                 i__1 = isamax_(&combla_1.n, sx, &combla_1.incx);
00302                 itest1_(&i__1, &itrue2[np1 - 1]);
00303             } else {
00304                 s_wsle(&io___31);
00305                 do_lio(&c__9, &c__1, " Shouldn't be here in CHECK1", (ftnlen)
00306                         28);
00307                 e_wsle();
00308                 s_stop("", (ftnlen)0);
00309             }
00310 /* L60: */
00311         }
00312 /* L80: */
00313     }
00314     return 0;
00315 } /* check1_ */
00316 
00317 /* Subroutine */ int check2_(real *sfac)
00318 {
00319     /* Initialized data */
00320 
00321     static real sa = .3f;
00322     static integer incxs[4] = { 1,2,-2,-1 };
00323     static integer incys[4] = { 1,-2,1,-2 };
00324     static integer lens[8]      /* was [4][2] */ = { 1,1,2,4,1,1,3,7 };
00325     static integer ns[4] = { 0,1,2,4 };
00326     static real dx1[7] = { .6f,.1f,-.5f,.8f,.9f,-.3f,-.4f };
00327     static real dy1[7] = { .5f,-.9f,.3f,.7f,-.6f,.2f,.8f };
00328     static real dt7[16] /* was [4][4] */ = { 0.f,.3f,.21f,.62f,0.f,.3f,-.07f,
00329             .85f,0.f,.3f,-.79f,-.74f,0.f,.3f,.33f,1.27f };
00330     static real dt8[112]        /* was [7][4][4] */ = { .5f,0.f,0.f,0.f,0.f,
00331             0.f,0.f,.68f,0.f,0.f,0.f,0.f,0.f,0.f,.68f,-.87f,0.f,0.f,0.f,0.f,
00332             0.f,.68f,-.87f,.15f,.94f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,
00333             .68f,0.f,0.f,0.f,0.f,0.f,0.f,.35f,-.9f,.48f,0.f,0.f,0.f,0.f,.38f,
00334             -.9f,.57f,.7f,-.75f,.2f,.98f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.68f,0.f,
00335             0.f,0.f,0.f,0.f,0.f,.35f,-.72f,0.f,0.f,0.f,0.f,0.f,.38f,-.63f,
00336             .15f,.88f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.68f,0.f,0.f,
00337             0.f,0.f,0.f,0.f,.68f,-.9f,.33f,0.f,0.f,0.f,0.f,.68f,-.9f,.33f,.7f,
00338             -.75f,.2f,1.04f };
00339     static real dt10x[112]      /* was [7][4][4] */ = { .6f,0.f,0.f,0.f,0.f,
00340             0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.5f,-.9f,0.f,0.f,0.f,0.f,0.f,
00341             .5f,-.9f,.3f,.7f,0.f,0.f,0.f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,.5f,0.f,
00342             0.f,0.f,0.f,0.f,0.f,.3f,.1f,.5f,0.f,0.f,0.f,0.f,.8f,.1f,-.6f,.8f,
00343             .3f,-.3f,.5f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,
00344             0.f,-.9f,.1f,.5f,0.f,0.f,0.f,0.f,.7f,.1f,.3f,.8f,-.9f,-.3f,.5f,
00345             .6f,0.f,0.f,0.f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.5f,.3f,
00346             0.f,0.f,0.f,0.f,0.f,.5f,.3f,-.6f,.8f,0.f,0.f,0.f };
00347     static real dt10y[112]      /* was [7][4][4] */ = { .5f,0.f,0.f,0.f,0.f,
00348             0.f,0.f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,.6f,.1f,0.f,0.f,0.f,0.f,0.f,
00349             .6f,.1f,-.5f,.8f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.6f,0.f,
00350             0.f,0.f,0.f,0.f,0.f,-.5f,-.9f,.6f,0.f,0.f,0.f,0.f,-.4f,-.9f,.9f,
00351             .7f,-.5f,.2f,.6f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.6f,0.f,0.f,0.f,0.f,
00352             0.f,0.f,-.5f,.6f,0.f,0.f,0.f,0.f,0.f,-.4f,.9f,-.5f,.6f,0.f,0.f,
00353             0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,.6f,
00354             -.9f,.1f,0.f,0.f,0.f,0.f,.6f,-.9f,.1f,.7f,-.5f,.2f,.8f };
00355     static real ssize1[4] = { 0.f,.3f,1.6f,3.2f };
00356     static real ssize2[28]      /* was [14][2] */ = { 0.f,0.f,0.f,0.f,0.f,0.f,
00357             0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,1.17f,1.17f,1.17f,1.17f,1.17f,
00358             1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f };
00359 
00360     /* System generated locals */
00361     integer i__1;
00362     real r__1;
00363 
00364     /* Builtin functions */
00365     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00366             e_wsle(void);
00367     /* Subroutine */ int s_stop(char *, ftnlen);
00368 
00369     /* Local variables */
00370     integer i__, j, ki, kn, mx, my;
00371     real sx[7], sy[7], stx[7], sty[7];
00372     integer lenx, leny;
00373     extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
00374     integer ksize;
00375     extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *, 
00376             integer *), sswap_(integer *, real *, integer *, real *, integer *
00377 ), stest_(integer *, real *, real *, real *, real *), saxpy_(
00378             integer *, real *, real *, integer *, real *, integer *), stest1_(
00379             real *, real *, real *, real *);
00380 
00381     /* Fortran I/O blocks */
00382     static cilist io___58 = { 0, 6, 0, 0, 0 };
00383 
00384 
00385 /*     .. Parameters .. */
00386 /*     .. Scalar Arguments .. */
00387 /*     .. Scalars in Common .. */
00388 /*     .. Local Scalars .. */
00389 /*     .. Local Arrays .. */
00390 /*     .. External Functions .. */
00391 /*     .. External Subroutines .. */
00392 /*     .. Intrinsic Functions .. */
00393 /*     .. Common blocks .. */
00394 /*     .. Data statements .. */
00395 /*     .. Executable Statements .. */
00396 
00397     for (ki = 1; ki <= 4; ++ki) {
00398         combla_1.incx = incxs[ki - 1];
00399         combla_1.incy = incys[ki - 1];
00400         mx = abs(combla_1.incx);
00401         my = abs(combla_1.incy);
00402 
00403         for (kn = 1; kn <= 4; ++kn) {
00404             combla_1.n = ns[kn - 1];
00405             ksize = min(2,kn);
00406             lenx = lens[kn + (mx << 2) - 5];
00407             leny = lens[kn + (my << 2) - 5];
00408 /*           .. Initialize all argument arrays .. */
00409             for (i__ = 1; i__ <= 7; ++i__) {
00410                 sx[i__ - 1] = dx1[i__ - 1];
00411                 sy[i__ - 1] = dy1[i__ - 1];
00412 /* L20: */
00413             }
00414 
00415             if (combla_1.icase == 1) {
00416 /*              .. SDOT .. */
00417                 r__1 = sdot_(&combla_1.n, sx, &combla_1.incx, sy, &
00418                         combla_1.incy);
00419                 stest1_(&r__1, &dt7[kn + (ki << 2) - 5], &ssize1[kn - 1], 
00420                         sfac);
00421             } else if (combla_1.icase == 2) {
00422 /*              .. SAXPY .. */
00423                 saxpy_(&combla_1.n, &sa, sx, &combla_1.incx, sy, &
00424                         combla_1.incy);
00425                 i__1 = leny;
00426                 for (j = 1; j <= i__1; ++j) {
00427                     sty[j - 1] = dt8[j + (kn + (ki << 2)) * 7 - 36];
00428 /* L40: */
00429                 }
00430                 stest_(&leny, sy, sty, &ssize2[ksize * 14 - 14], sfac);
00431             } else if (combla_1.icase == 5) {
00432 /*              .. SCOPY .. */
00433                 for (i__ = 1; i__ <= 7; ++i__) {
00434                     sty[i__ - 1] = dt10y[i__ + (kn + (ki << 2)) * 7 - 36];
00435 /* L60: */
00436                 }
00437                 scopy_(&combla_1.n, sx, &combla_1.incx, sy, &combla_1.incy);
00438                 stest_(&leny, sy, sty, ssize2, &c_b34);
00439             } else if (combla_1.icase == 6) {
00440 /*              .. SSWAP .. */
00441                 sswap_(&combla_1.n, sx, &combla_1.incx, sy, &combla_1.incy);
00442                 for (i__ = 1; i__ <= 7; ++i__) {
00443                     stx[i__ - 1] = dt10x[i__ + (kn + (ki << 2)) * 7 - 36];
00444                     sty[i__ - 1] = dt10y[i__ + (kn + (ki << 2)) * 7 - 36];
00445 /* L80: */
00446                 }
00447                 stest_(&lenx, sx, stx, ssize2, &c_b34);
00448                 stest_(&leny, sy, sty, ssize2, &c_b34);
00449             } else {
00450                 s_wsle(&io___58);
00451                 do_lio(&c__9, &c__1, " Shouldn't be here in CHECK2", (ftnlen)
00452                         28);
00453                 e_wsle();
00454                 s_stop("", (ftnlen)0);
00455             }
00456 /* L100: */
00457         }
00458 /* L120: */
00459     }
00460     return 0;
00461 } /* check2_ */
00462 
00463 /* Subroutine */ int check3_(real *sfac)
00464 {
00465     /* Initialized data */
00466 
00467     static integer incxs[4] = { 1,2,-2,-1 };
00468     static integer incys[4] = { 1,-2,1,-2 };
00469     static integer lens[8]      /* was [4][2] */ = { 1,1,2,4,1,1,3,7 };
00470     static integer ns[4] = { 0,1,2,4 };
00471     static real dx1[7] = { .6f,.1f,-.5f,.8f,.9f,-.3f,-.4f };
00472     static real dy1[7] = { .5f,-.9f,.3f,.7f,-.6f,.2f,.8f };
00473     static real sc = .8f;
00474     static real ss = .6f;
00475     static real dt9x[112]       /* was [7][4][4] */ = { .6f,0.f,0.f,0.f,0.f,
00476             0.f,0.f,.78f,0.f,0.f,0.f,0.f,0.f,0.f,.78f,-.46f,0.f,0.f,0.f,0.f,
00477             0.f,.78f,-.46f,-.22f,1.06f,0.f,0.f,0.f,.6f,0.f,0.f,0.f,0.f,0.f,
00478             0.f,.78f,0.f,0.f,0.f,0.f,0.f,0.f,.66f,.1f,-.1f,0.f,0.f,0.f,0.f,
00479             .96f,.1f,-.76f,.8f,.9f,-.3f,-.02f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,
00480             .78f,0.f,0.f,0.f,0.f,0.f,0.f,-.06f,.1f,-.1f,0.f,0.f,0.f,0.f,.9f,
00481             .1f,-.22f,.8f,.18f,-.3f,-.02f,.6f,0.f,0.f,0.f,0.f,0.f,0.f,.78f,
00482             0.f,0.f,0.f,0.f,0.f,0.f,.78f,.26f,0.f,0.f,0.f,0.f,0.f,.78f,.26f,
00483             -.76f,1.12f,0.f,0.f,0.f };
00484     static real dt9y[112]       /* was [7][4][4] */ = { .5f,0.f,0.f,0.f,0.f,
00485             0.f,0.f,.04f,0.f,0.f,0.f,0.f,0.f,0.f,.04f,-.78f,0.f,0.f,0.f,0.f,
00486             0.f,.04f,-.78f,.54f,.08f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,
00487             .04f,0.f,0.f,0.f,0.f,0.f,0.f,.7f,-.9f,-.12f,0.f,0.f,0.f,0.f,.64f,
00488             -.9f,-.3f,.7f,-.18f,.2f,.28f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.04f,0.f,
00489             0.f,0.f,0.f,0.f,0.f,.7f,-1.08f,0.f,0.f,0.f,0.f,0.f,.64f,-1.26f,
00490             .54f,.2f,0.f,0.f,0.f,.5f,0.f,0.f,0.f,0.f,0.f,0.f,.04f,0.f,0.f,0.f,
00491             0.f,0.f,0.f,.04f,-.9f,.18f,0.f,0.f,0.f,0.f,.04f,-.9f,.18f,.7f,
00492             -.18f,.2f,.16f };
00493     static real ssize2[28]      /* was [14][2] */ = { 0.f,0.f,0.f,0.f,0.f,0.f,
00494             0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,1.17f,1.17f,1.17f,1.17f,1.17f,
00495             1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f,1.17f };
00496 
00497     /* Builtin functions */
00498     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
00499             e_wsle(void);
00500     /* Subroutine */ int s_stop(char *, ftnlen);
00501 
00502     /* Local variables */
00503     integer i__, k, ki, kn, mx, my;
00504     real sx[7], sy[7], stx[7], sty[7];
00505     integer lenx, leny;
00506     real mwpc[11];
00507     integer mwpn[11];
00508     real mwps[11];
00509     extern /* Subroutine */ int srot_(integer *, real *, integer *, real *, 
00510             integer *, real *, real *);
00511     real mwpx[5], mwpy[5];
00512     integer ksize;
00513     real copyx[5], copyy[5];
00514     extern /* Subroutine */ int stest_(integer *, real *, real *, real *, 
00515             real *);
00516     real mwptx[55]      /* was [11][5] */, mwpty[55]    /* was [11][5] */;
00517     integer mwpinx[11], mwpiny[11];
00518     real mwpstx[5], mwpsty[5];
00519 
00520     /* Fortran I/O blocks */
00521     static cilist io___82 = { 0, 6, 0, 0, 0 };
00522 
00523 
00524 /*     .. Parameters .. */
00525 /*     .. Scalar Arguments .. */
00526 /*     .. Scalars in Common .. */
00527 /*     .. Local Scalars .. */
00528 /*     .. Local Arrays .. */
00529 /*     .. External Subroutines .. */
00530 /*     .. Intrinsic Functions .. */
00531 /*     .. Common blocks .. */
00532 /*     .. Data statements .. */
00533 /*     .. Executable Statements .. */
00534 
00535     for (ki = 1; ki <= 4; ++ki) {
00536         combla_1.incx = incxs[ki - 1];
00537         combla_1.incy = incys[ki - 1];
00538         mx = abs(combla_1.incx);
00539         my = abs(combla_1.incy);
00540 
00541         for (kn = 1; kn <= 4; ++kn) {
00542             combla_1.n = ns[kn - 1];
00543             ksize = min(2,kn);
00544             lenx = lens[kn + (mx << 2) - 5];
00545             leny = lens[kn + (my << 2) - 5];
00546 
00547             if (combla_1.icase == 4) {
00548 /*              .. SROT .. */
00549                 for (i__ = 1; i__ <= 7; ++i__) {
00550                     sx[i__ - 1] = dx1[i__ - 1];
00551                     sy[i__ - 1] = dy1[i__ - 1];
00552                     stx[i__ - 1] = dt9x[i__ + (kn + (ki << 2)) * 7 - 36];
00553                     sty[i__ - 1] = dt9y[i__ + (kn + (ki << 2)) * 7 - 36];
00554 /* L20: */
00555                 }
00556                 srot_(&combla_1.n, sx, &combla_1.incx, sy, &combla_1.incy, &
00557                         sc, &ss);
00558                 stest_(&lenx, sx, stx, &ssize2[ksize * 14 - 14], sfac);
00559                 stest_(&leny, sy, sty, &ssize2[ksize * 14 - 14], sfac);
00560             } else {
00561                 s_wsle(&io___82);
00562                 do_lio(&c__9, &c__1, " Shouldn't be here in CHECK3", (ftnlen)
00563                         28);
00564                 e_wsle();
00565                 s_stop("", (ftnlen)0);
00566             }
00567 /* L40: */
00568         }
00569 /* L60: */
00570     }
00571 
00572     mwpc[0] = 1.f;
00573     for (i__ = 2; i__ <= 11; ++i__) {
00574         mwpc[i__ - 1] = 0.f;
00575 /* L80: */
00576     }
00577     mwps[0] = 0.f;
00578     for (i__ = 2; i__ <= 6; ++i__) {
00579         mwps[i__ - 1] = 1.f;
00580 /* L100: */
00581     }
00582     for (i__ = 7; i__ <= 11; ++i__) {
00583         mwps[i__ - 1] = -1.f;
00584 /* L120: */
00585     }
00586     mwpinx[0] = 1;
00587     mwpinx[1] = 1;
00588     mwpinx[2] = 1;
00589     mwpinx[3] = -1;
00590     mwpinx[4] = 1;
00591     mwpinx[5] = -1;
00592     mwpinx[6] = 1;
00593     mwpinx[7] = 1;
00594     mwpinx[8] = -1;
00595     mwpinx[9] = 1;
00596     mwpinx[10] = -1;
00597     mwpiny[0] = 1;
00598     mwpiny[1] = 1;
00599     mwpiny[2] = -1;
00600     mwpiny[3] = -1;
00601     mwpiny[4] = 2;
00602     mwpiny[5] = 1;
00603     mwpiny[6] = 1;
00604     mwpiny[7] = -1;
00605     mwpiny[8] = -1;
00606     mwpiny[9] = 2;
00607     mwpiny[10] = 1;
00608     for (i__ = 1; i__ <= 11; ++i__) {
00609         mwpn[i__ - 1] = 5;
00610 /* L140: */
00611     }
00612     mwpn[4] = 3;
00613     mwpn[9] = 3;
00614     for (i__ = 1; i__ <= 5; ++i__) {
00615         mwpx[i__ - 1] = (real) i__;
00616         mwpy[i__ - 1] = (real) i__;
00617         mwptx[i__ * 11 - 11] = (real) i__;
00618         mwpty[i__ * 11 - 11] = (real) i__;
00619         mwptx[i__ * 11 - 10] = (real) i__;
00620         mwpty[i__ * 11 - 10] = (real) (-i__);
00621         mwptx[i__ * 11 - 9] = (real) (6 - i__);
00622         mwpty[i__ * 11 - 9] = (real) (i__ - 6);
00623         mwptx[i__ * 11 - 8] = (real) i__;
00624         mwpty[i__ * 11 - 8] = (real) (-i__);
00625         mwptx[i__ * 11 - 6] = (real) (6 - i__);
00626         mwpty[i__ * 11 - 6] = (real) (i__ - 6);
00627         mwptx[i__ * 11 - 5] = (real) (-i__);
00628         mwpty[i__ * 11 - 5] = (real) i__;
00629         mwptx[i__ * 11 - 4] = (real) (i__ - 6);
00630         mwpty[i__ * 11 - 4] = (real) (6 - i__);
00631         mwptx[i__ * 11 - 3] = (real) (-i__);
00632         mwpty[i__ * 11 - 3] = (real) i__;
00633         mwptx[i__ * 11 - 1] = (real) (i__ - 6);
00634         mwpty[i__ * 11 - 1] = (real) (6 - i__);
00635 /* L160: */
00636     }
00637     mwptx[4] = 1.f;
00638     mwptx[15] = 3.f;
00639     mwptx[26] = 5.f;
00640     mwptx[37] = 4.f;
00641     mwptx[48] = 5.f;
00642     mwpty[4] = -1.f;
00643     mwpty[15] = 2.f;
00644     mwpty[26] = -2.f;
00645     mwpty[37] = 4.f;
00646     mwpty[48] = -3.f;
00647     mwptx[9] = -1.f;
00648     mwptx[20] = -3.f;
00649     mwptx[31] = -5.f;
00650     mwptx[42] = 4.f;
00651     mwptx[53] = 5.f;
00652     mwpty[9] = 1.f;
00653     mwpty[20] = 2.f;
00654     mwpty[31] = 2.f;
00655     mwpty[42] = 4.f;
00656     mwpty[53] = 3.f;
00657     for (i__ = 1; i__ <= 11; ++i__) {
00658         combla_1.incx = mwpinx[i__ - 1];
00659         combla_1.incy = mwpiny[i__ - 1];
00660         for (k = 1; k <= 5; ++k) {
00661             copyx[k - 1] = mwpx[k - 1];
00662             copyy[k - 1] = mwpy[k - 1];
00663             mwpstx[k - 1] = mwptx[i__ + k * 11 - 12];
00664             mwpsty[k - 1] = mwpty[i__ + k * 11 - 12];
00665 /* L180: */
00666         }
00667         srot_(&mwpn[i__ - 1], copyx, &combla_1.incx, copyy, &combla_1.incy, &
00668                 mwpc[i__ - 1], &mwps[i__ - 1]);
00669         stest_(&c__5, copyx, mwpstx, mwpstx, sfac);
00670         stest_(&c__5, copyy, mwpsty, mwpsty, sfac);
00671 /* L200: */
00672     }
00673     return 0;
00674 } /* check3_ */
00675 
00676 /* Subroutine */ int stest_(integer *len, real *scomp, real *strue, real *
00677         ssize, real *sfac)
00678 {
00679     /* Format strings */
00680     static char fmt_99999[] = "(\002                                       F"
00681             "AIL\002)";
00682     static char fmt_99998[] = "(/\002 CASE  N INCX INCY MODE  I             "
00683             "               \002,\002 COMP(I)                             TRU"
00684             "E(I)  DIFFERENCE\002,\002     SIZE(I)\002,/1x)";
00685     static char fmt_99997[] = "(1x,i4,i3,3i5,i3,2e36.8,2e12.4)";
00686 
00687     /* System generated locals */
00688     integer i__1;
00689     real r__1, r__2, r__3, r__4, r__5;
00690 
00691     /* Builtin functions */
00692     integer s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, char *, ftnlen);
00693 
00694     /* Local variables */
00695     integer i__;
00696     real sd;
00697     extern doublereal sdiff_(real *, real *);
00698 
00699     /* Fortran I/O blocks */
00700     static cilist io___99 = { 0, 6, 0, fmt_99999, 0 };
00701     static cilist io___100 = { 0, 6, 0, fmt_99998, 0 };
00702     static cilist io___101 = { 0, 6, 0, fmt_99997, 0 };
00703 
00704 
00705 /*     ********************************* STEST ************************** */
00706 
00707 /*     THIS SUBR COMPARES ARRAYS  SCOMP() AND STRUE() OF LENGTH LEN TO */
00708 /*     SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE */
00709 /*     NEGLIGIBLE. */
00710 
00711 /*     C. L. LAWSON, JPL, 1974 DEC 10 */
00712 
00713 /*     .. Parameters .. */
00714 /*     .. Scalar Arguments .. */
00715 /*     .. Array Arguments .. */
00716 /*     .. Scalars in Common .. */
00717 /*     .. Local Scalars .. */
00718 /*     .. External Functions .. */
00719 /*     .. Intrinsic Functions .. */
00720 /*     .. Common blocks .. */
00721 /*     .. Executable Statements .. */
00722 
00723     /* Parameter adjustments */
00724     --ssize;
00725     --strue;
00726     --scomp;
00727 
00728     /* Function Body */
00729     i__1 = *len;
00730     for (i__ = 1; i__ <= i__1; ++i__) {
00731         sd = scomp[i__] - strue[i__];
00732         r__4 = (r__1 = ssize[i__], dabs(r__1)) + (r__2 = *sfac * sd, dabs(
00733                 r__2));
00734         r__5 = (r__3 = ssize[i__], dabs(r__3));
00735         if (sdiff_(&r__4, &r__5) == 0.f) {
00736             goto L40;
00737         }
00738 
00739 /*                             HERE    SCOMP(I) IS NOT CLOSE TO STRUE(I). */
00740 
00741         if (! combla_1.pass) {
00742             goto L20;
00743         }
00744 /*                             PRINT FAIL MESSAGE AND HEADER. */
00745         combla_1.pass = FALSE_;
00746         s_wsfe(&io___99);
00747         e_wsfe();
00748         s_wsfe(&io___100);
00749         e_wsfe();
00750 L20:
00751         s_wsfe(&io___101);
00752         do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00753         do_fio(&c__1, (char *)&combla_1.n, (ftnlen)sizeof(integer));
00754         do_fio(&c__1, (char *)&combla_1.incx, (ftnlen)sizeof(integer));
00755         do_fio(&c__1, (char *)&combla_1.incy, (ftnlen)sizeof(integer));
00756         do_fio(&c__1, (char *)&combla_1.mode, (ftnlen)sizeof(integer));
00757         do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
00758         do_fio(&c__1, (char *)&scomp[i__], (ftnlen)sizeof(real));
00759         do_fio(&c__1, (char *)&strue[i__], (ftnlen)sizeof(real));
00760         do_fio(&c__1, (char *)&sd, (ftnlen)sizeof(real));
00761         do_fio(&c__1, (char *)&ssize[i__], (ftnlen)sizeof(real));
00762         e_wsfe();
00763 L40:
00764         ;
00765     }
00766     return 0;
00767 
00768 } /* stest_ */
00769 
00770 /* Subroutine */ int stest1_(real *scomp1, real *strue1, real *ssize, real *
00771         sfac)
00772 {
00773     real scomp[1], strue[1];
00774     extern /* Subroutine */ int stest_(integer *, real *, real *, real *, 
00775             real *);
00776 
00777 /*     ************************* STEST1 ***************************** */
00778 
00779 /*     THIS IS AN INTERFACE SUBROUTINE TO ACCOMODATE THE FORTRAN */
00780 /*     REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE */
00781 /*     ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT. */
00782 
00783 /*     C.L. LAWSON, JPL, 1978 DEC 6 */
00784 
00785 /*     .. Scalar Arguments .. */
00786 /*     .. Array Arguments .. */
00787 /*     .. Local Arrays .. */
00788 /*     .. External Subroutines .. */
00789 /*     .. Executable Statements .. */
00790 
00791     /* Parameter adjustments */
00792     --ssize;
00793 
00794     /* Function Body */
00795     scomp[0] = *scomp1;
00796     strue[0] = *strue1;
00797     stest_(&c__1, scomp, strue, &ssize[1], sfac);
00798 
00799     return 0;
00800 } /* stest1_ */
00801 
00802 doublereal sdiff_(real *sa, real *sb)
00803 {
00804     /* System generated locals */
00805     real ret_val;
00806 
00807 /*     ********************************* SDIFF ************************** */
00808 /*     COMPUTES DIFFERENCE OF TWO NUMBERS.  C. L. LAWSON, JPL 1974 FEB 15 */
00809 
00810 /*     .. Scalar Arguments .. */
00811 /*     .. Executable Statements .. */
00812     ret_val = *sa - *sb;
00813     return ret_val;
00814 } /* sdiff_ */
00815 
00816 /* Subroutine */ int itest1_(integer *icomp, integer *itrue)
00817 {
00818     /* Format strings */
00819     static char fmt_99999[] = "(\002                                       F"
00820             "AIL\002)";
00821     static char fmt_99998[] = "(/\002 CASE  N INCX INCY MODE                "
00822             "               \002,\002 COMP                                TRU"
00823             "E     DIFFERENCE\002,/1x)";
00824     static char fmt_99997[] = "(1x,i4,i3,3i5,2i36,i12)";
00825 
00826     /* Builtin functions */
00827     integer s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, char *, ftnlen);
00828 
00829     /* Local variables */
00830     integer id;
00831 
00832     /* Fortran I/O blocks */
00833     static cilist io___104 = { 0, 6, 0, fmt_99999, 0 };
00834     static cilist io___105 = { 0, 6, 0, fmt_99998, 0 };
00835     static cilist io___107 = { 0, 6, 0, fmt_99997, 0 };
00836 
00837 
00838 /*     ********************************* ITEST1 ************************* */
00839 
00840 /*     THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR */
00841 /*     EQUALITY. */
00842 /*     C. L. LAWSON, JPL, 1974 DEC 10 */
00843 
00844 /*     .. Parameters .. */
00845 /*     .. Scalar Arguments .. */
00846 /*     .. Scalars in Common .. */
00847 /*     .. Local Scalars .. */
00848 /*     .. Common blocks .. */
00849 /*     .. Executable Statements .. */
00850 
00851     if (*icomp == *itrue) {
00852         goto L40;
00853     }
00854 
00855 /*                            HERE ICOMP IS NOT EQUAL TO ITRUE. */
00856 
00857     if (! combla_1.pass) {
00858         goto L20;
00859     }
00860 /*                             PRINT FAIL MESSAGE AND HEADER. */
00861     combla_1.pass = FALSE_;
00862     s_wsfe(&io___104);
00863     e_wsfe();
00864     s_wsfe(&io___105);
00865     e_wsfe();
00866 L20:
00867     id = *icomp - *itrue;
00868     s_wsfe(&io___107);
00869     do_fio(&c__1, (char *)&combla_1.icase, (ftnlen)sizeof(integer));
00870     do_fio(&c__1, (char *)&combla_1.n, (ftnlen)sizeof(integer));
00871     do_fio(&c__1, (char *)&combla_1.incx, (ftnlen)sizeof(integer));
00872     do_fio(&c__1, (char *)&combla_1.incy, (ftnlen)sizeof(integer));
00873     do_fio(&c__1, (char *)&combla_1.mode, (ftnlen)sizeof(integer));
00874     do_fio(&c__1, (char *)&(*icomp), (ftnlen)sizeof(integer));
00875     do_fio(&c__1, (char *)&(*itrue), (ftnlen)sizeof(integer));
00876     do_fio(&c__1, (char *)&id, (ftnlen)sizeof(integer));
00877     e_wsfe();
00878 L40:
00879     return 0;
00880 
00881 } /* itest1_ */
00882 
00883 /* Main program alias */ int sblat1_ () { MAIN__ (); return 0; }


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