schkrfp.c
Go to the documentation of this file.
00001 /* schkrfp.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 /* Table of constant values */
00017 
00018 static integer c__1 = 1;
00019 static integer c__3 = 3;
00020 static integer c__12 = 12;
00021 static integer c__0 = 0;
00022 static integer c__50 = 50;
00023 static integer c__16 = 16;
00024 static integer c__9 = 9;
00025 static integer c__4 = 4;
00026 static integer c__8 = 8;
00027 static integer c__6 = 6;
00028 
00029 /* Main program */ int MAIN__(void)
00030 {
00031     /* Format strings */
00032     static char fmt_9994[] = "(/\002 Tests of the REAL LAPACK RFP routines"
00033             " \002,/\002 LAPACK VERSION \002,i1,\002.\002,i1,\002.\002,i1,/"
00034             "/\002 The following parameter values will be used:\002)";
00035     static char fmt_9996[] = "(\002 !! Invalid input value: \002,a4,\002="
00036             "\002,i6,\002; must be >=\002,i6)";
00037     static char fmt_9995[] = "(\002 !! Invalid input value: \002,a4,\002="
00038             "\002,i6,\002; must be <=\002,i6)";
00039     static char fmt_9993[] = "(4x,a4,\002:  \002,10i6,/11x,10i6)";
00040     static char fmt_9992[] = "(/\002 Routines pass computational tests if te"
00041             "st ratio is \002,\002less than\002,f8.2,/)";
00042     static char fmt_9999[] = "(/\002 Execution not attempted due to input er"
00043             "rors\002)";
00044     static char fmt_9991[] = "(\002 Relative machine \002,a,\002 is taken to"
00045             " be\002,d16.6)";
00046     static char fmt_9998[] = "(/\002 End of tests\002)";
00047     static char fmt_9997[] = "(\002 Total time used = \002,f12.2,\002 seco"
00048             "nds\002,/)";
00049 
00050     /* System generated locals */
00051     integer i__1;
00052     real r__1;
00053     cllist cl__1;
00054 
00055     /* Builtin functions */
00056     integer s_rsle(cilist *), e_rsle(void), s_wsfe(cilist *), do_fio(integer *
00057             , char *, ftnlen), e_wsfe(void), do_lio(integer *, integer *, 
00058             char *, ftnlen);
00059     /* Subroutine */ int s_stop(char *, ftnlen);
00060     integer s_wsle(cilist *), e_wsle(void), f_clos(cllist *);
00061 
00062     /* Local variables */
00063     real workafac[2500] /* was [50][50] */, workasav[2500]      /* was [50][
00064             50] */, workbsav[800]       /* was [50][16] */, workainv[2500]      
00065             /* was [50][50] */, workxact[800]   /* was [50][16] */;
00066     integer i__;
00067     real s1, s2;
00068     integer nn, vers_patch__, vers_major__, vers_minor__;
00069     real workarfinv[1275], eps;
00070     integer nns, nnt, nval[12];
00071     real s_temp_spot02__[800]   /* was [50][16] */, s_temp_spot03__[2500]       
00072             /* was [50][50] */, s_work_spot01__[50], s_work_spot02__[50], 
00073             s_work_spot03__[50];
00074     logical fatal;
00075     integer nsval[12], ntval[9];
00076     real worka[2500]    /* was [50][50] */, workb[800]  /* was [50][16] */, 
00077             workx[800]  /* was [50][16] */, s_work_slatms__[150], 
00078             s_work_slansy__[50];
00079     extern doublereal slamch_(char *), second_(void);
00080     extern /* Subroutine */ int ilaver_(integer *, integer *, integer *);
00081     real thresh, workap[1275];
00082     logical tsterr;
00083     extern /* Subroutine */ int sdrvrf1_(integer *, integer *, integer *, 
00084             real *, real *, integer *, real *, real *), sdrvrf2_(integer *, 
00085             integer *, integer *, real *, integer *, real *, real *, real *), 
00086             sdrvrf3_(integer *, integer *, integer *, real *, real *, integer 
00087             *, real *, real *, real *, real *, real *, real *), sdrvrf4_(
00088             integer *, integer *, integer *, real *, real *, real *, integer *
00089 , real *, real *, integer *, real *);
00090     real workarf[1275];
00091     extern /* Subroutine */ int serrrfp_(integer *), sdrvrfp_(integer *, 
00092             integer *, integer *, integer *, integer *, integer *, integer *, 
00093             real *, real *, real *, real *, real *, real *, real *, real *, 
00094             real *, real *, real *, real *, real *, real *, real *, real *, 
00095             real *, real *);
00096 
00097     /* Fortran I/O blocks */
00098     static cilist io___3 = { 0, 5, 0, 0, 0 };
00099     static cilist io___7 = { 0, 6, 0, fmt_9994, 0 };
00100     static cilist io___8 = { 0, 5, 0, 0, 0 };
00101     static cilist io___10 = { 0, 6, 0, fmt_9996, 0 };
00102     static cilist io___11 = { 0, 6, 0, fmt_9995, 0 };
00103     static cilist io___12 = { 0, 5, 0, 0, 0 };
00104     static cilist io___15 = { 0, 6, 0, fmt_9996, 0 };
00105     static cilist io___16 = { 0, 6, 0, fmt_9995, 0 };
00106     static cilist io___17 = { 0, 6, 0, fmt_9993, 0 };
00107     static cilist io___18 = { 0, 5, 0, 0, 0 };
00108     static cilist io___20 = { 0, 6, 0, fmt_9996, 0 };
00109     static cilist io___21 = { 0, 6, 0, fmt_9995, 0 };
00110     static cilist io___22 = { 0, 5, 0, 0, 0 };
00111     static cilist io___24 = { 0, 6, 0, fmt_9996, 0 };
00112     static cilist io___25 = { 0, 6, 0, fmt_9995, 0 };
00113     static cilist io___26 = { 0, 6, 0, fmt_9993, 0 };
00114     static cilist io___27 = { 0, 5, 0, 0, 0 };
00115     static cilist io___29 = { 0, 6, 0, fmt_9996, 0 };
00116     static cilist io___30 = { 0, 6, 0, fmt_9995, 0 };
00117     static cilist io___31 = { 0, 5, 0, 0, 0 };
00118     static cilist io___33 = { 0, 6, 0, fmt_9996, 0 };
00119     static cilist io___34 = { 0, 6, 0, fmt_9995, 0 };
00120     static cilist io___35 = { 0, 6, 0, fmt_9993, 0 };
00121     static cilist io___36 = { 0, 5, 0, 0, 0 };
00122     static cilist io___38 = { 0, 6, 0, fmt_9992, 0 };
00123     static cilist io___39 = { 0, 5, 0, 0, 0 };
00124     static cilist io___41 = { 0, 6, 0, fmt_9999, 0 };
00125     static cilist io___42 = { 0, 6, 0, fmt_9999, 0 };
00126     static cilist io___44 = { 0, 6, 0, fmt_9991, 0 };
00127     static cilist io___45 = { 0, 6, 0, fmt_9991, 0 };
00128     static cilist io___46 = { 0, 6, 0, fmt_9991, 0 };
00129     static cilist io___47 = { 0, 6, 0, 0, 0 };
00130     static cilist io___67 = { 0, 6, 0, fmt_9998, 0 };
00131     static cilist io___68 = { 0, 6, 0, fmt_9997, 0 };
00132 
00133 
00134 
00135 /*  -- LAPACK test routine (version 3.2.0) -- */
00136 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00137 /*     November 2008 */
00138 
00139 /*  Purpose */
00140 /*  ======= */
00141 
00142 /*  SCHKRFP is the main test program for the REAL linear */
00143 /*  equation routines with RFP storage format */
00144 
00145 
00146 /*  Internal Parameters */
00147 /*  =================== */
00148 
00149 /*  MAXIN   INTEGER */
00150 /*          The number of different values that can be used for each of */
00151 /*          M, N, or NB */
00152 
00153 /*  MAXRHS  INTEGER */
00154 /*          The maximum number of right hand sides */
00155 
00156 /*  NTYPES  INTEGER */
00157 
00158 /*  NMAX    INTEGER */
00159 /*          The maximum allowable value for N. */
00160 
00161 /*  NIN     INTEGER */
00162 /*          The unit number for input */
00163 
00164 /*  NOUT    INTEGER */
00165 /*          The unit number for output */
00166 
00167 /*  ===================================================================== */
00168 
00169 /*     .. Parameters .. */
00170 /*     .. */
00171 /*     .. Local Scalars .. */
00172 /*     .. */
00173 /*     .. Local Arrays .. */
00174 /*     .. */
00175 /*     .. External Functions .. */
00176 /*     .. */
00177 /*     .. External Subroutines .. */
00178 /*     .. */
00179 /*     .. Executable Statements .. */
00180 
00181     s1 = second_();
00182     fatal = FALSE_;
00183 
00184 /*     Read a dummy line. */
00185 
00186     s_rsle(&io___3);
00187     e_rsle();
00188 
00189 /*     Report LAPACK version tag (e.g. LAPACK-3.2.0) */
00190 
00191     ilaver_(&vers_major__, &vers_minor__, &vers_patch__);
00192     s_wsfe(&io___7);
00193     do_fio(&c__1, (char *)&vers_major__, (ftnlen)sizeof(integer));
00194     do_fio(&c__1, (char *)&vers_minor__, (ftnlen)sizeof(integer));
00195     do_fio(&c__1, (char *)&vers_patch__, (ftnlen)sizeof(integer));
00196     e_wsfe();
00197 
00198 /*     Read the values of N */
00199 
00200     s_rsle(&io___8);
00201     do_lio(&c__3, &c__1, (char *)&nn, (ftnlen)sizeof(integer));
00202     e_rsle();
00203     if (nn < 1) {
00204         s_wsfe(&io___10);
00205         do_fio(&c__1, " NN ", (ftnlen)4);
00206         do_fio(&c__1, (char *)&nn, (ftnlen)sizeof(integer));
00207         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00208         e_wsfe();
00209         nn = 0;
00210         fatal = TRUE_;
00211     } else if (nn > 12) {
00212         s_wsfe(&io___11);
00213         do_fio(&c__1, " NN ", (ftnlen)4);
00214         do_fio(&c__1, (char *)&nn, (ftnlen)sizeof(integer));
00215         do_fio(&c__1, (char *)&c__12, (ftnlen)sizeof(integer));
00216         e_wsfe();
00217         nn = 0;
00218         fatal = TRUE_;
00219     }
00220     s_rsle(&io___12);
00221     i__1 = nn;
00222     for (i__ = 1; i__ <= i__1; ++i__) {
00223         do_lio(&c__3, &c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00224     }
00225     e_rsle();
00226     i__1 = nn;
00227     for (i__ = 1; i__ <= i__1; ++i__) {
00228         if (nval[i__ - 1] < 0) {
00229             s_wsfe(&io___15);
00230             do_fio(&c__1, " M  ", (ftnlen)4);
00231             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00232             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00233             e_wsfe();
00234             fatal = TRUE_;
00235         } else if (nval[i__ - 1] > 50) {
00236             s_wsfe(&io___16);
00237             do_fio(&c__1, " M  ", (ftnlen)4);
00238             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00239             do_fio(&c__1, (char *)&c__50, (ftnlen)sizeof(integer));
00240             e_wsfe();
00241             fatal = TRUE_;
00242         }
00243 /* L10: */
00244     }
00245     if (nn > 0) {
00246         s_wsfe(&io___17);
00247         do_fio(&c__1, "N   ", (ftnlen)4);
00248         i__1 = nn;
00249         for (i__ = 1; i__ <= i__1; ++i__) {
00250             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00251         }
00252         e_wsfe();
00253     }
00254 
00255 /*     Read the values of NRHS */
00256 
00257     s_rsle(&io___18);
00258     do_lio(&c__3, &c__1, (char *)&nns, (ftnlen)sizeof(integer));
00259     e_rsle();
00260     if (nns < 1) {
00261         s_wsfe(&io___20);
00262         do_fio(&c__1, " NNS", (ftnlen)4);
00263         do_fio(&c__1, (char *)&nns, (ftnlen)sizeof(integer));
00264         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00265         e_wsfe();
00266         nns = 0;
00267         fatal = TRUE_;
00268     } else if (nns > 12) {
00269         s_wsfe(&io___21);
00270         do_fio(&c__1, " NNS", (ftnlen)4);
00271         do_fio(&c__1, (char *)&nns, (ftnlen)sizeof(integer));
00272         do_fio(&c__1, (char *)&c__12, (ftnlen)sizeof(integer));
00273         e_wsfe();
00274         nns = 0;
00275         fatal = TRUE_;
00276     }
00277     s_rsle(&io___22);
00278     i__1 = nns;
00279     for (i__ = 1; i__ <= i__1; ++i__) {
00280         do_lio(&c__3, &c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer))
00281                 ;
00282     }
00283     e_rsle();
00284     i__1 = nns;
00285     for (i__ = 1; i__ <= i__1; ++i__) {
00286         if (nsval[i__ - 1] < 0) {
00287             s_wsfe(&io___24);
00288             do_fio(&c__1, "NRHS", (ftnlen)4);
00289             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00290             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00291             e_wsfe();
00292             fatal = TRUE_;
00293         } else if (nsval[i__ - 1] > 16) {
00294             s_wsfe(&io___25);
00295             do_fio(&c__1, "NRHS", (ftnlen)4);
00296             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00297             do_fio(&c__1, (char *)&c__16, (ftnlen)sizeof(integer));
00298             e_wsfe();
00299             fatal = TRUE_;
00300         }
00301 /* L30: */
00302     }
00303     if (nns > 0) {
00304         s_wsfe(&io___26);
00305         do_fio(&c__1, "NRHS", (ftnlen)4);
00306         i__1 = nns;
00307         for (i__ = 1; i__ <= i__1; ++i__) {
00308             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00309         }
00310         e_wsfe();
00311     }
00312 
00313 /*     Read the matrix types */
00314 
00315     s_rsle(&io___27);
00316     do_lio(&c__3, &c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00317     e_rsle();
00318     if (nnt < 1) {
00319         s_wsfe(&io___29);
00320         do_fio(&c__1, " NMA", (ftnlen)4);
00321         do_fio(&c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00322         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00323         e_wsfe();
00324         nnt = 0;
00325         fatal = TRUE_;
00326     } else if (nnt > 9) {
00327         s_wsfe(&io___30);
00328         do_fio(&c__1, " NMA", (ftnlen)4);
00329         do_fio(&c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00330         do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00331         e_wsfe();
00332         nnt = 0;
00333         fatal = TRUE_;
00334     }
00335     s_rsle(&io___31);
00336     i__1 = nnt;
00337     for (i__ = 1; i__ <= i__1; ++i__) {
00338         do_lio(&c__3, &c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer))
00339                 ;
00340     }
00341     e_rsle();
00342     i__1 = nnt;
00343     for (i__ = 1; i__ <= i__1; ++i__) {
00344         if (ntval[i__ - 1] < 0) {
00345             s_wsfe(&io___33);
00346             do_fio(&c__1, "TYPE", (ftnlen)4);
00347             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00348             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00349             e_wsfe();
00350             fatal = TRUE_;
00351         } else if (ntval[i__ - 1] > 9) {
00352             s_wsfe(&io___34);
00353             do_fio(&c__1, "TYPE", (ftnlen)4);
00354             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00355             do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00356             e_wsfe();
00357             fatal = TRUE_;
00358         }
00359 /* L320: */
00360     }
00361     if (nnt > 0) {
00362         s_wsfe(&io___35);
00363         do_fio(&c__1, "TYPE", (ftnlen)4);
00364         i__1 = nnt;
00365         for (i__ = 1; i__ <= i__1; ++i__) {
00366             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00367         }
00368         e_wsfe();
00369     }
00370 
00371 /*     Read the threshold value for the test ratios. */
00372 
00373     s_rsle(&io___36);
00374     do_lio(&c__4, &c__1, (char *)&thresh, (ftnlen)sizeof(real));
00375     e_rsle();
00376     s_wsfe(&io___38);
00377     do_fio(&c__1, (char *)&thresh, (ftnlen)sizeof(real));
00378     e_wsfe();
00379 
00380 /*     Read the flag that indicates whether to test the error exits. */
00381 
00382     s_rsle(&io___39);
00383     do_lio(&c__8, &c__1, (char *)&tsterr, (ftnlen)sizeof(logical));
00384     e_rsle();
00385 
00386     if (fatal) {
00387         s_wsfe(&io___41);
00388         e_wsfe();
00389         s_stop("", (ftnlen)0);
00390     }
00391 
00392     if (fatal) {
00393         s_wsfe(&io___42);
00394         e_wsfe();
00395         s_stop("", (ftnlen)0);
00396     }
00397 
00398 /*     Calculate and print the machine dependent constants. */
00399 
00400     eps = slamch_("Underflow threshold");
00401     s_wsfe(&io___44);
00402     do_fio(&c__1, "underflow", (ftnlen)9);
00403     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(real));
00404     e_wsfe();
00405     eps = slamch_("Overflow threshold");
00406     s_wsfe(&io___45);
00407     do_fio(&c__1, "overflow ", (ftnlen)9);
00408     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(real));
00409     e_wsfe();
00410     eps = slamch_("Epsilon");
00411     s_wsfe(&io___46);
00412     do_fio(&c__1, "precision", (ftnlen)9);
00413     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(real));
00414     e_wsfe();
00415     s_wsle(&io___47);
00416     e_wsle();
00417 
00418 /*     Test the error exit of: */
00419 
00420     if (tsterr) {
00421         serrrfp_(&c__6);
00422     }
00423 
00424 /*     Test the routines: spftrf, spftri, spftrs (as in SDRVPO). */
00425 /*     This also tests the routines: stfsm, stftri, stfttr, strttf. */
00426 
00427     sdrvrfp_(&c__6, &nn, nval, &nns, nsval, &nnt, ntval, &thresh, worka, 
00428             workasav, workafac, workainv, workb, workbsav, workxact, workx, 
00429             workarf, workarfinv, s_work_slatms__, s_work_spot01__, 
00430             s_temp_spot02__, s_temp_spot03__, s_work_slansy__, 
00431             s_work_spot02__, s_work_spot03__);
00432 
00433 /*     Test the routine: slansf */
00434 
00435     sdrvrf1_(&c__6, &nn, nval, &thresh, worka, &c__50, workarf, 
00436             s_work_slansy__);
00437 
00438 /*     Test the convertion routines: */
00439 /*       stfttp, stpttf, stfttr, strttf, strttp and stpttr. */
00440 
00441     sdrvrf2_(&c__6, &nn, nval, worka, &c__50, workarf, workap, workasav);
00442 
00443 /*     Test the routine: stfsm */
00444 
00445     sdrvrf3_(&c__6, &nn, nval, &thresh, worka, &c__50, workarf, workainv, 
00446             workafac, s_work_slansy__, s_work_spot03__, s_work_spot01__);
00447 
00448 
00449 /*     Test the routine: ssfrk */
00450 
00451     sdrvrf4_(&c__6, &nn, nval, &thresh, worka, workafac, &c__50, workarf, 
00452             workainv, &c__50, s_work_slansy__);
00453 
00454     cl__1.cerr = 0;
00455     cl__1.cunit = 5;
00456     cl__1.csta = 0;
00457     f_clos(&cl__1);
00458     s2 = second_();
00459     s_wsfe(&io___67);
00460     e_wsfe();
00461     s_wsfe(&io___68);
00462     r__1 = s2 - s1;
00463     do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
00464     e_wsfe();
00465 
00466 
00467 /*     End of SCHKRFP */
00468 
00469     return 0;
00470 } /* MAIN__ */
00471 
00472 /* Main program alias */ int schkrfp_ () { MAIN__ (); return 0; }


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