zchkrfp.c
Go to the documentation of this file.
00001 /* zchkrfp.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__5 = 5;
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 COMPLEX*16 LAPACK RFP rout"
00033             "ines \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     doublereal d__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     doublecomplex workafac[2500]        /* was [50][50] */, workasav[2500]      
00064             /* was [50][50] */, workbsav[800]   /* was [50][16] */, workainv[
00065             2500]       /* was [50][50] */, workxact[800]       /* was [50][
00066             16] */;
00067     integer i__;
00068     doublereal s1, s2;
00069     integer nn, vers_patch__, vers_major__, vers_minor__;
00070     doublecomplex workarfinv[1275];
00071     doublereal eps;
00072     integer nns, nnt, nval[12];
00073     doublereal d_work_zpot02__[50], d_work_zpot03__[50];
00074     doublecomplex z_work_zpot01__[50];
00075     logical fatal;
00076     doublecomplex z_work_zpot02__[800]  /* was [50][16] */, z_work_zpot03__[
00077             2500]       /* was [50][50] */;
00078     integer nsval[12], ntval[9];
00079     doublecomplex worka[2500]   /* was [50][50] */, workb[800]  /* was [50][
00080             16] */, workx[800]  /* was [50][16] */;
00081     doublereal d_work_zlanhe__[50], d_work_zlatms__[50];
00082     extern doublereal dlamch_(char *), dsecnd_(void);
00083     doublecomplex z_work_zlatms__[150];
00084     extern /* Subroutine */ int ilaver_(integer *, integer *, integer *);
00085     doublereal thresh;
00086     doublecomplex workap[1275];
00087     logical tsterr;
00088     extern /* Subroutine */ int zdrvrf1_(integer *, integer *, integer *, 
00089             doublereal *, doublecomplex *, integer *, doublecomplex *, 
00090             doublereal *), zdrvrf2_(integer *, integer *, integer *, 
00091             doublecomplex *, integer *, doublecomplex *, doublecomplex *, 
00092             doublecomplex *), zdrvrf3_(integer *, integer *, integer *, 
00093             doublereal *, doublecomplex *, integer *, doublecomplex *, 
00094             doublecomplex *, doublecomplex *, doublereal *, doublecomplex *, 
00095             doublecomplex *), zdrvrf4_(integer *, integer *, integer *, 
00096             doublereal *, doublecomplex *, doublecomplex *, integer *, 
00097             doublecomplex *, doublecomplex *, integer *, doublereal *);
00098     doublecomplex workarf[1275];
00099     extern /* Subroutine */ int zerrrfp_(integer *), zdrvrfp_(integer *, 
00100             integer *, integer *, integer *, integer *, integer *, integer *, 
00101             doublereal *, doublecomplex *, doublecomplex *, doublecomplex *, 
00102             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00103 , doublecomplex *, doublecomplex *, doublecomplex *, 
00104             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00105 , doublereal *, doublereal *, doublereal *, doublereal *);
00106 
00107     /* Fortran I/O blocks */
00108     static cilist io___3 = { 0, 5, 0, 0, 0 };
00109     static cilist io___7 = { 0, 6, 0, fmt_9994, 0 };
00110     static cilist io___8 = { 0, 5, 0, 0, 0 };
00111     static cilist io___10 = { 0, 6, 0, fmt_9996, 0 };
00112     static cilist io___11 = { 0, 6, 0, fmt_9995, 0 };
00113     static cilist io___12 = { 0, 5, 0, 0, 0 };
00114     static cilist io___15 = { 0, 6, 0, fmt_9996, 0 };
00115     static cilist io___16 = { 0, 6, 0, fmt_9995, 0 };
00116     static cilist io___17 = { 0, 6, 0, fmt_9993, 0 };
00117     static cilist io___18 = { 0, 5, 0, 0, 0 };
00118     static cilist io___20 = { 0, 6, 0, fmt_9996, 0 };
00119     static cilist io___21 = { 0, 6, 0, fmt_9995, 0 };
00120     static cilist io___22 = { 0, 5, 0, 0, 0 };
00121     static cilist io___24 = { 0, 6, 0, fmt_9996, 0 };
00122     static cilist io___25 = { 0, 6, 0, fmt_9995, 0 };
00123     static cilist io___26 = { 0, 6, 0, fmt_9993, 0 };
00124     static cilist io___27 = { 0, 5, 0, 0, 0 };
00125     static cilist io___29 = { 0, 6, 0, fmt_9996, 0 };
00126     static cilist io___30 = { 0, 6, 0, fmt_9995, 0 };
00127     static cilist io___31 = { 0, 5, 0, 0, 0 };
00128     static cilist io___33 = { 0, 6, 0, fmt_9996, 0 };
00129     static cilist io___34 = { 0, 6, 0, fmt_9995, 0 };
00130     static cilist io___35 = { 0, 6, 0, fmt_9993, 0 };
00131     static cilist io___36 = { 0, 5, 0, 0, 0 };
00132     static cilist io___38 = { 0, 6, 0, fmt_9992, 0 };
00133     static cilist io___39 = { 0, 5, 0, 0, 0 };
00134     static cilist io___41 = { 0, 6, 0, fmt_9999, 0 };
00135     static cilist io___42 = { 0, 6, 0, fmt_9999, 0 };
00136     static cilist io___44 = { 0, 6, 0, fmt_9991, 0 };
00137     static cilist io___45 = { 0, 6, 0, fmt_9991, 0 };
00138     static cilist io___46 = { 0, 6, 0, fmt_9991, 0 };
00139     static cilist io___47 = { 0, 6, 0, 0, 0 };
00140     static cilist io___68 = { 0, 6, 0, fmt_9998, 0 };
00141     static cilist io___69 = { 0, 6, 0, fmt_9997, 0 };
00142 
00143 
00144 
00145 /*  -- LAPACK test routine (version 3.2.0) -- */
00146 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00147 /*     November 2008 */
00148 
00149 /*  Purpose */
00150 /*  ======= */
00151 
00152 /*  ZCHKRFP is the main test program for the COMPLEX*16 linear equation */
00153 /*  routines with RFP storage format */
00154 
00155 
00156 /*  Internal Parameters */
00157 /*  =================== */
00158 
00159 /*  MAXIN   INTEGER */
00160 /*          The number of different values that can be used for each of */
00161 /*          M, N, or NB */
00162 
00163 /*  MAXRHS  INTEGER */
00164 /*          The maximum number of right hand sides */
00165 
00166 /*  NTYPES  INTEGER */
00167 
00168 /*  NMAX    INTEGER */
00169 /*          The maximum allowable value for N. */
00170 
00171 /*  NIN     INTEGER */
00172 /*          The unit number for input */
00173 
00174 /*  NOUT    INTEGER */
00175 /*          The unit number for output */
00176 
00177 /*  ===================================================================== */
00178 
00179 /*     .. Parameters .. */
00180 /*     .. */
00181 /*     .. Local Scalars .. */
00182 /*     .. */
00183 /*     .. Local Arrays .. */
00184 /*     .. */
00185 /*     .. External Functions .. */
00186 /*     .. */
00187 /*     .. External Subroutines .. */
00188 /*     .. */
00189 /*     .. Executable Statements .. */
00190 
00191     s1 = dsecnd_();
00192     fatal = FALSE_;
00193 
00194 /*     Read a dummy line. */
00195 
00196     s_rsle(&io___3);
00197     e_rsle();
00198 
00199 /*     Report LAPACK version tag (e.g. LAPACK-3.2.0) */
00200 
00201     ilaver_(&vers_major__, &vers_minor__, &vers_patch__);
00202     s_wsfe(&io___7);
00203     do_fio(&c__1, (char *)&vers_major__, (ftnlen)sizeof(integer));
00204     do_fio(&c__1, (char *)&vers_minor__, (ftnlen)sizeof(integer));
00205     do_fio(&c__1, (char *)&vers_patch__, (ftnlen)sizeof(integer));
00206     e_wsfe();
00207 
00208 /*     Read the values of N */
00209 
00210     s_rsle(&io___8);
00211     do_lio(&c__3, &c__1, (char *)&nn, (ftnlen)sizeof(integer));
00212     e_rsle();
00213     if (nn < 1) {
00214         s_wsfe(&io___10);
00215         do_fio(&c__1, " NN ", (ftnlen)4);
00216         do_fio(&c__1, (char *)&nn, (ftnlen)sizeof(integer));
00217         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00218         e_wsfe();
00219         nn = 0;
00220         fatal = TRUE_;
00221     } else if (nn > 12) {
00222         s_wsfe(&io___11);
00223         do_fio(&c__1, " NN ", (ftnlen)4);
00224         do_fio(&c__1, (char *)&nn, (ftnlen)sizeof(integer));
00225         do_fio(&c__1, (char *)&c__12, (ftnlen)sizeof(integer));
00226         e_wsfe();
00227         nn = 0;
00228         fatal = TRUE_;
00229     }
00230     s_rsle(&io___12);
00231     i__1 = nn;
00232     for (i__ = 1; i__ <= i__1; ++i__) {
00233         do_lio(&c__3, &c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00234     }
00235     e_rsle();
00236     i__1 = nn;
00237     for (i__ = 1; i__ <= i__1; ++i__) {
00238         if (nval[i__ - 1] < 0) {
00239             s_wsfe(&io___15);
00240             do_fio(&c__1, " M  ", (ftnlen)4);
00241             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00242             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00243             e_wsfe();
00244             fatal = TRUE_;
00245         } else if (nval[i__ - 1] > 50) {
00246             s_wsfe(&io___16);
00247             do_fio(&c__1, " M  ", (ftnlen)4);
00248             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00249             do_fio(&c__1, (char *)&c__50, (ftnlen)sizeof(integer));
00250             e_wsfe();
00251             fatal = TRUE_;
00252         }
00253 /* L10: */
00254     }
00255     if (nn > 0) {
00256         s_wsfe(&io___17);
00257         do_fio(&c__1, "N   ", (ftnlen)4);
00258         i__1 = nn;
00259         for (i__ = 1; i__ <= i__1; ++i__) {
00260             do_fio(&c__1, (char *)&nval[i__ - 1], (ftnlen)sizeof(integer));
00261         }
00262         e_wsfe();
00263     }
00264 
00265 /*     Read the values of NRHS */
00266 
00267     s_rsle(&io___18);
00268     do_lio(&c__3, &c__1, (char *)&nns, (ftnlen)sizeof(integer));
00269     e_rsle();
00270     if (nns < 1) {
00271         s_wsfe(&io___20);
00272         do_fio(&c__1, " NNS", (ftnlen)4);
00273         do_fio(&c__1, (char *)&nns, (ftnlen)sizeof(integer));
00274         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00275         e_wsfe();
00276         nns = 0;
00277         fatal = TRUE_;
00278     } else if (nns > 12) {
00279         s_wsfe(&io___21);
00280         do_fio(&c__1, " NNS", (ftnlen)4);
00281         do_fio(&c__1, (char *)&nns, (ftnlen)sizeof(integer));
00282         do_fio(&c__1, (char *)&c__12, (ftnlen)sizeof(integer));
00283         e_wsfe();
00284         nns = 0;
00285         fatal = TRUE_;
00286     }
00287     s_rsle(&io___22);
00288     i__1 = nns;
00289     for (i__ = 1; i__ <= i__1; ++i__) {
00290         do_lio(&c__3, &c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer))
00291                 ;
00292     }
00293     e_rsle();
00294     i__1 = nns;
00295     for (i__ = 1; i__ <= i__1; ++i__) {
00296         if (nsval[i__ - 1] < 0) {
00297             s_wsfe(&io___24);
00298             do_fio(&c__1, "NRHS", (ftnlen)4);
00299             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00300             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00301             e_wsfe();
00302             fatal = TRUE_;
00303         } else if (nsval[i__ - 1] > 16) {
00304             s_wsfe(&io___25);
00305             do_fio(&c__1, "NRHS", (ftnlen)4);
00306             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00307             do_fio(&c__1, (char *)&c__16, (ftnlen)sizeof(integer));
00308             e_wsfe();
00309             fatal = TRUE_;
00310         }
00311 /* L30: */
00312     }
00313     if (nns > 0) {
00314         s_wsfe(&io___26);
00315         do_fio(&c__1, "NRHS", (ftnlen)4);
00316         i__1 = nns;
00317         for (i__ = 1; i__ <= i__1; ++i__) {
00318             do_fio(&c__1, (char *)&nsval[i__ - 1], (ftnlen)sizeof(integer));
00319         }
00320         e_wsfe();
00321     }
00322 
00323 /*     Read the matrix types */
00324 
00325     s_rsle(&io___27);
00326     do_lio(&c__3, &c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00327     e_rsle();
00328     if (nnt < 1) {
00329         s_wsfe(&io___29);
00330         do_fio(&c__1, " NMA", (ftnlen)4);
00331         do_fio(&c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00332         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00333         e_wsfe();
00334         nnt = 0;
00335         fatal = TRUE_;
00336     } else if (nnt > 9) {
00337         s_wsfe(&io___30);
00338         do_fio(&c__1, " NMA", (ftnlen)4);
00339         do_fio(&c__1, (char *)&nnt, (ftnlen)sizeof(integer));
00340         do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00341         e_wsfe();
00342         nnt = 0;
00343         fatal = TRUE_;
00344     }
00345     s_rsle(&io___31);
00346     i__1 = nnt;
00347     for (i__ = 1; i__ <= i__1; ++i__) {
00348         do_lio(&c__3, &c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer))
00349                 ;
00350     }
00351     e_rsle();
00352     i__1 = nnt;
00353     for (i__ = 1; i__ <= i__1; ++i__) {
00354         if (ntval[i__ - 1] < 0) {
00355             s_wsfe(&io___33);
00356             do_fio(&c__1, "TYPE", (ftnlen)4);
00357             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00358             do_fio(&c__1, (char *)&c__0, (ftnlen)sizeof(integer));
00359             e_wsfe();
00360             fatal = TRUE_;
00361         } else if (ntval[i__ - 1] > 9) {
00362             s_wsfe(&io___34);
00363             do_fio(&c__1, "TYPE", (ftnlen)4);
00364             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00365             do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00366             e_wsfe();
00367             fatal = TRUE_;
00368         }
00369 /* L320: */
00370     }
00371     if (nnt > 0) {
00372         s_wsfe(&io___35);
00373         do_fio(&c__1, "TYPE", (ftnlen)4);
00374         i__1 = nnt;
00375         for (i__ = 1; i__ <= i__1; ++i__) {
00376             do_fio(&c__1, (char *)&ntval[i__ - 1], (ftnlen)sizeof(integer));
00377         }
00378         e_wsfe();
00379     }
00380 
00381 /*     Read the threshold value for the test ratios. */
00382 
00383     s_rsle(&io___36);
00384     do_lio(&c__5, &c__1, (char *)&thresh, (ftnlen)sizeof(doublereal));
00385     e_rsle();
00386     s_wsfe(&io___38);
00387     do_fio(&c__1, (char *)&thresh, (ftnlen)sizeof(doublereal));
00388     e_wsfe();
00389 
00390 /*     Read the flag that indicates whether to test the error exits. */
00391 
00392     s_rsle(&io___39);
00393     do_lio(&c__8, &c__1, (char *)&tsterr, (ftnlen)sizeof(logical));
00394     e_rsle();
00395 
00396     if (fatal) {
00397         s_wsfe(&io___41);
00398         e_wsfe();
00399         s_stop("", (ftnlen)0);
00400     }
00401 
00402     if (fatal) {
00403         s_wsfe(&io___42);
00404         e_wsfe();
00405         s_stop("", (ftnlen)0);
00406     }
00407 
00408 /*     Calculate and print the machine dependent constants. */
00409 
00410     eps = dlamch_("Underflow threshold");
00411     s_wsfe(&io___44);
00412     do_fio(&c__1, "underflow", (ftnlen)9);
00413     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(doublereal));
00414     e_wsfe();
00415     eps = dlamch_("Overflow threshold");
00416     s_wsfe(&io___45);
00417     do_fio(&c__1, "overflow ", (ftnlen)9);
00418     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(doublereal));
00419     e_wsfe();
00420     eps = dlamch_("Epsilon");
00421     s_wsfe(&io___46);
00422     do_fio(&c__1, "precision", (ftnlen)9);
00423     do_fio(&c__1, (char *)&eps, (ftnlen)sizeof(doublereal));
00424     e_wsfe();
00425     s_wsle(&io___47);
00426     e_wsle();
00427 
00428 /*     Test the error exit of: */
00429 
00430     if (tsterr) {
00431         zerrrfp_(&c__6);
00432     }
00433 
00434 /*    Test the routines: zpftrf, zpftri, zpftrs (as in ZDRVPO). */
00435 /*    This also tests the routines: ztfsm, ztftri, ztfttr, ztrttf. */
00436 
00437     zdrvrfp_(&c__6, &nn, nval, &nns, nsval, &nnt, ntval, &thresh, worka, 
00438             workasav, workafac, workainv, workb, workbsav, workxact, workx, 
00439             workarf, workarfinv, z_work_zlatms__, z_work_zpot01__, 
00440             z_work_zpot02__, z_work_zpot03__, d_work_zlatms__, 
00441             d_work_zlanhe__, d_work_zpot02__, d_work_zpot03__);
00442 
00443 /*    Test the routine: zlanhf */
00444 
00445     zdrvrf1_(&c__6, &nn, nval, &thresh, worka, &c__50, workarf, 
00446             d_work_zlanhe__);
00447 
00448 /*    Test the convertion routines: */
00449 /*       zhfttp, ztpthf, ztfttr, ztrttf, ztrttp and ztpttr. */
00450 
00451     zdrvrf2_(&c__6, &nn, nval, worka, &c__50, workarf, workap, workasav);
00452 
00453 /*    Test the routine: ztfsm */
00454 
00455     zdrvrf3_(&c__6, &nn, nval, &thresh, worka, &c__50, workarf, workainv, 
00456             workafac, d_work_zlanhe__, z_work_zpot03__, z_work_zpot01__);
00457 
00458 /*    Test the routine: zhfrk */
00459 
00460     zdrvrf4_(&c__6, &nn, nval, &thresh, worka, workafac, &c__50, workarf, 
00461             workainv, &c__50, d_work_zlanhe__);
00462 
00463     cl__1.cerr = 0;
00464     cl__1.cunit = 5;
00465     cl__1.csta = 0;
00466     f_clos(&cl__1);
00467     s2 = dsecnd_();
00468     s_wsfe(&io___68);
00469     e_wsfe();
00470     s_wsfe(&io___69);
00471     d__1 = s2 - s1;
00472     do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
00473     e_wsfe();
00474 
00475 
00476 /*     End of ZCHKRFP */
00477 
00478     return 0;
00479 } /* MAIN__ */
00480 
00481 /* Main program alias */ int zchkrfp_ () { MAIN__ (); return 0; }


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