zdrvrf2.c
Go to the documentation of this file.
00001 /* zdrvrf2.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     char srnamt[32];
00020 } srnamc_;
00021 
00022 #define srnamc_1 srnamc_
00023 
00024 /* Table of constant values */
00025 
00026 static integer c__4 = 4;
00027 static integer c__1 = 1;
00028 
00029 /* Subroutine */ int zdrvrf2_(integer *nout, integer *nn, integer *nval, 
00030         doublecomplex *a, integer *lda, doublecomplex *arf, doublecomplex *ap, 
00031          doublecomplex *asav)
00032 {
00033     /* Initialized data */
00034 
00035     static integer iseedy[4] = { 1988,1989,1990,1991 };
00036     static char uplos[1*2] = "U" "L";
00037     static char forms[1*2] = "N" "C";
00038 
00039     /* Format strings */
00040     static char fmt_9999[] = "(1x,\002 *** Error(s) while testing the RFP co"
00041             "nvertion\002,\002 routines ***\002)";
00042     static char fmt_9998[] = "(1x,\002     Error in RFP,convertion routines "
00043             "N=\002,i5,\002 UPLO='\002,a1,\002', FORM ='\002,a1,\002'\002)";
00044     static char fmt_9997[] = "(1x,\002All tests for the RFP convertion routi"
00045             "nes passed (\002,i5,\002 tests run)\002)";
00046     static char fmt_9996[] = "(1x,\002RFP convertion routines:\002,i5,\002 o"
00047             "ut of \002,i5,\002 error message recorded\002)";
00048 
00049     /* System generated locals */
00050     integer a_dim1, a_offset, asav_dim1, asav_offset, i__1, i__2, i__3, i__4, 
00051             i__5;
00052     doublecomplex z__1;
00053 
00054     /* Builtin functions */
00055     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00056     integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void), 
00057             do_fio(integer *, char *, ftnlen);
00058 
00059     /* Local variables */
00060     integer i__, j, n;
00061     logical ok1, ok2;
00062     integer iin, info;
00063     char uplo[1];
00064     integer nrun, iseed[4];
00065     char cform[1];
00066     integer iform;
00067     logical lower;
00068     integer iuplo, nerrs;
00069     extern /* Double Complex */ VOID zlarnd_(doublecomplex *, integer *, 
00070             integer *);
00071     extern /* Subroutine */ int ztfttp_(char *, char *, integer *, 
00072             doublecomplex *, doublecomplex *, integer *), 
00073             ztpttf_(char *, char *, integer *, doublecomplex *, doublecomplex 
00074             *, integer *), ztfttr_(char *, char *, integer *, 
00075             doublecomplex *, doublecomplex *, integer *, integer *), ztrttf_(char *, char *, integer *, doublecomplex *, 
00076             integer *, doublecomplex *, integer *), ztrttp_(
00077             char *, integer *, doublecomplex *, integer *, doublecomplex *, 
00078             integer *), ztpttr_(char *, integer *, doublecomplex *, 
00079             doublecomplex *, integer *, integer *);
00080 
00081     /* Fortran I/O blocks */
00082     static cilist io___19 = { 0, 0, 0, 0, 0 };
00083     static cilist io___20 = { 0, 0, 0, fmt_9999, 0 };
00084     static cilist io___21 = { 0, 0, 0, fmt_9998, 0 };
00085     static cilist io___22 = { 0, 0, 0, fmt_9997, 0 };
00086     static cilist io___23 = { 0, 0, 0, fmt_9996, 0 };
00087 
00088 
00089 
00090 
00091 /*  -- LAPACK test routine (version 3.2.0) -- */
00092 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00093 /*     November 2008 */
00094 
00095 /*     .. Scalar Arguments .. */
00096 /*     .. */
00097 /*     .. Array Arguments .. */
00098 /*     .. */
00099 
00100 /*  Purpose */
00101 /*  ======= */
00102 
00103 /*  ZDRVRF2 tests the LAPACK RFP convertion routines. */
00104 
00105 /*  Arguments */
00106 /*  ========= */
00107 
00108 /*  NOUT          (input) INTEGER */
00109 /*                The unit number for output. */
00110 
00111 /*  NN            (input) INTEGER */
00112 /*                The number of values of N contained in the vector NVAL. */
00113 
00114 /*  NVAL          (input) INTEGER array, dimension (NN) */
00115 /*                The values of the matrix dimension N. */
00116 
00117 /*  A             (workspace) COMPLEX*16 array, dimension (LDA,NMAX) */
00118 
00119 /*  LDA           (input) INTEGER */
00120 /*                The leading dimension of the array A.  LDA >= max(1,NMAX). */
00121 
00122 /*  ARF           (workspace) COMPLEX*16 array, dimension ((NMAX*(NMAX+1))/2). */
00123 
00124 /*  AP            (workspace) COMPLEX*16 array, dimension ((NMAX*(NMAX+1))/2). */
00125 
00126 /*  A2            (workspace) COMPLEX*16 array, dimension (LDA,NMAX) */
00127 
00128 /*  ===================================================================== */
00129 /*     .. */
00130 /*     .. Local Scalars .. */
00131 /*     .. */
00132 /*     .. Local Arrays .. */
00133 /*     .. */
00134 /*     .. External Functions .. */
00135 /*     .. */
00136 /*     .. External Subroutines .. */
00137 /*     .. */
00138 /*     .. Scalars in Common .. */
00139 /*     .. */
00140 /*     .. Common blocks .. */
00141 /*     .. */
00142 /*     .. Data statements .. */
00143     /* Parameter adjustments */
00144     --nval;
00145     asav_dim1 = *lda;
00146     asav_offset = 1 + asav_dim1;
00147     asav -= asav_offset;
00148     a_dim1 = *lda;
00149     a_offset = 1 + a_dim1;
00150     a -= a_offset;
00151     --arf;
00152     --ap;
00153 
00154     /* Function Body */
00155 /*     .. */
00156 /*     .. Executable Statements .. */
00157 
00158 /*     Initialize constants and the random number seed. */
00159 
00160     nrun = 0;
00161     nerrs = 0;
00162     info = 0;
00163     for (i__ = 1; i__ <= 4; ++i__) {
00164         iseed[i__ - 1] = iseedy[i__ - 1];
00165 /* L10: */
00166     }
00167 
00168     i__1 = *nn;
00169     for (iin = 1; iin <= i__1; ++iin) {
00170 
00171         n = nval[iin];
00172 
00173 /*        Do first for UPLO = 'U', then for UPLO = 'L' */
00174 
00175         for (iuplo = 1; iuplo <= 2; ++iuplo) {
00176 
00177             *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00178             lower = TRUE_;
00179             if (iuplo == 1) {
00180                 lower = FALSE_;
00181             }
00182 
00183 /*           Do first for CFORM = 'N', then for CFORM = 'C' */
00184 
00185             for (iform = 1; iform <= 2; ++iform) {
00186 
00187                 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00188 
00189                 ++nrun;
00190 
00191                 i__2 = n;
00192                 for (j = 1; j <= i__2; ++j) {
00193                     i__3 = n;
00194                     for (i__ = 1; i__ <= i__3; ++i__) {
00195                         i__4 = i__ + j * a_dim1;
00196                         zlarnd_(&z__1, &c__4, iseed);
00197                         a[i__4].r = z__1.r, a[i__4].i = z__1.i;
00198                     }
00199                 }
00200 
00201                 s_copy(srnamc_1.srnamt, "ZTRTTF", (ftnlen)32, (ftnlen)6);
00202                 ztrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &info);
00203 
00204                 s_copy(srnamc_1.srnamt, "ZTFTTP", (ftnlen)32, (ftnlen)6);
00205                 ztfttp_(cform, uplo, &n, &arf[1], &ap[1], &info);
00206 
00207                 s_copy(srnamc_1.srnamt, "ZTPTTR", (ftnlen)32, (ftnlen)6);
00208                 ztpttr_(uplo, &n, &ap[1], &asav[asav_offset], lda, &info);
00209 
00210                 ok1 = TRUE_;
00211                 if (lower) {
00212                     i__2 = n;
00213                     for (j = 1; j <= i__2; ++j) {
00214                         i__3 = n;
00215                         for (i__ = j; i__ <= i__3; ++i__) {
00216                             i__4 = i__ + j * a_dim1;
00217                             i__5 = i__ + j * asav_dim1;
00218                             if (a[i__4].r != asav[i__5].r || a[i__4].i != 
00219                                     asav[i__5].i) {
00220                                 ok1 = FALSE_;
00221                             }
00222                         }
00223                     }
00224                 } else {
00225                     i__2 = n;
00226                     for (j = 1; j <= i__2; ++j) {
00227                         i__3 = j;
00228                         for (i__ = 1; i__ <= i__3; ++i__) {
00229                             i__4 = i__ + j * a_dim1;
00230                             i__5 = i__ + j * asav_dim1;
00231                             if (a[i__4].r != asav[i__5].r || a[i__4].i != 
00232                                     asav[i__5].i) {
00233                                 ok1 = FALSE_;
00234                             }
00235                         }
00236                     }
00237                 }
00238 
00239                 ++nrun;
00240 
00241                 s_copy(srnamc_1.srnamt, "ZTRTTP", (ftnlen)32, (ftnlen)6);
00242                 ztrttp_(uplo, &n, &a[a_offset], lda, &ap[1], &info)
00243                         ;
00244 
00245                 s_copy(srnamc_1.srnamt, "ZTPTTF", (ftnlen)32, (ftnlen)6);
00246                 ztpttf_(cform, uplo, &n, &ap[1], &arf[1], &info);
00247 
00248                 s_copy(srnamc_1.srnamt, "ZTFTTR", (ftnlen)32, (ftnlen)6);
00249                 ztfttr_(cform, uplo, &n, &arf[1], &asav[asav_offset], lda, &
00250                         info);
00251 
00252                 ok2 = TRUE_;
00253                 if (lower) {
00254                     i__2 = n;
00255                     for (j = 1; j <= i__2; ++j) {
00256                         i__3 = n;
00257                         for (i__ = j; i__ <= i__3; ++i__) {
00258                             i__4 = i__ + j * a_dim1;
00259                             i__5 = i__ + j * asav_dim1;
00260                             if (a[i__4].r != asav[i__5].r || a[i__4].i != 
00261                                     asav[i__5].i) {
00262                                 ok2 = FALSE_;
00263                             }
00264                         }
00265                     }
00266                 } else {
00267                     i__2 = n;
00268                     for (j = 1; j <= i__2; ++j) {
00269                         i__3 = j;
00270                         for (i__ = 1; i__ <= i__3; ++i__) {
00271                             i__4 = i__ + j * a_dim1;
00272                             i__5 = i__ + j * asav_dim1;
00273                             if (a[i__4].r != asav[i__5].r || a[i__4].i != 
00274                                     asav[i__5].i) {
00275                                 ok2 = FALSE_;
00276                             }
00277                         }
00278                     }
00279                 }
00280 
00281                 if (! ok1 || ! ok2) {
00282                     if (nerrs == 0) {
00283                         io___19.ciunit = *nout;
00284                         s_wsle(&io___19);
00285                         e_wsle();
00286                         io___20.ciunit = *nout;
00287                         s_wsfe(&io___20);
00288                         e_wsfe();
00289                     }
00290                     io___21.ciunit = *nout;
00291                     s_wsfe(&io___21);
00292                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00293                     do_fio(&c__1, uplo, (ftnlen)1);
00294                     do_fio(&c__1, cform, (ftnlen)1);
00295                     e_wsfe();
00296                     ++nerrs;
00297                 }
00298 
00299 /* L100: */
00300             }
00301 /* L110: */
00302         }
00303 /* L120: */
00304     }
00305 
00306 /*     Print a summary of the results. */
00307 
00308     if (nerrs == 0) {
00309         io___22.ciunit = *nout;
00310         s_wsfe(&io___22);
00311         do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00312         e_wsfe();
00313     } else {
00314         io___23.ciunit = *nout;
00315         s_wsfe(&io___23);
00316         do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00317         do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00318         e_wsfe();
00319     }
00320 
00321 
00322     return 0;
00323 
00324 /*     End of ZDRVRF2 */
00325 
00326 } /* zdrvrf2_ */


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