ddrvrf2.c
Go to the documentation of this file.
00001 /* ddrvrf2.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__2 = 2;
00027 static integer c__1 = 1;
00028 
00029 /* Subroutine */ int ddrvrf2_(integer *nout, integer *nn, integer *nval, 
00030         doublereal *a, integer *lda, doublereal *arf, doublereal *ap, 
00031         doublereal *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" "T";
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;
00051 
00052     /* Builtin functions */
00053     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00054     integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void), 
00055             do_fio(integer *, char *, ftnlen);
00056 
00057     /* Local variables */
00058     integer i__, j, n;
00059     logical ok1, ok2;
00060     integer iin, info;
00061     char uplo[1];
00062     integer nrun, iseed[4];
00063     char cform[1];
00064     integer iform;
00065     logical lower;
00066     integer iuplo, nerrs;
00067     extern doublereal dlarnd_(integer *, integer *);
00068     extern /* Subroutine */ int dtfttp_(char *, char *, integer *, doublereal 
00069             *, doublereal *, integer *), dtpttf_(char *, char 
00070             *, integer *, doublereal *, doublereal *, integer *), dtfttr_(char *, char *, integer *, doublereal *, 
00071             doublereal *, integer *, integer *), dtrttf_(char 
00072             *, char *, integer *, doublereal *, integer *, doublereal *, 
00073             integer *), dtrttp_(char *, integer *, doublereal 
00074             *, integer *, doublereal *, integer *), dtpttr_(char *, 
00075             integer *, doublereal *, doublereal *, integer *, integer *);
00076 
00077     /* Fortran I/O blocks */
00078     static cilist io___19 = { 0, 0, 0, 0, 0 };
00079     static cilist io___20 = { 0, 0, 0, fmt_9999, 0 };
00080     static cilist io___21 = { 0, 0, 0, fmt_9998, 0 };
00081     static cilist io___22 = { 0, 0, 0, fmt_9997, 0 };
00082     static cilist io___23 = { 0, 0, 0, fmt_9996, 0 };
00083 
00084 
00085 
00086 /*  -- LAPACK test routine (version 3.2.0) -- */
00087 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00088 /*     November 2008 */
00089 
00090 /*     .. Scalar Arguments .. */
00091 /*     .. */
00092 /*     .. Array Arguments .. */
00093 /*     .. */
00094 
00095 /*  Purpose */
00096 /*  ======= */
00097 
00098 /*  DDRVRF2 tests the LAPACK RFP convertion routines. */
00099 
00100 /*  Arguments */
00101 /*  ========= */
00102 
00103 /*  NOUT          (input) INTEGER */
00104 /*                The unit number for output. */
00105 
00106 /*  NN            (input) INTEGER */
00107 /*                The number of values of N contained in the vector NVAL. */
00108 
00109 /*  NVAL          (input) INTEGER array, dimension (NN) */
00110 /*                The values of the matrix dimension N. */
00111 
00112 /*  A             (workspace) DOUBLE PRECISION array, dimension (LDA,NMAX) */
00113 
00114 /*  LDA           (input) INTEGER */
00115 /*                The leading dimension of the array A.  LDA >= max(1,NMAX). */
00116 
00117 /*  ARF           (workspace) DOUBLE PRECISION array, dimension ((NMAX*(NMAX+1))/2). */
00118 
00119 /*  AP            (workspace) DOUBLE PRECISION array, dimension ((NMAX*(NMAX+1))/2). */
00120 
00121 /*  A2            (workspace) DOUBLE PRECISION array, dimension (LDA,NMAX) */
00122 
00123 /*  ===================================================================== */
00124 /*     .. */
00125 /*     .. Local Scalars .. */
00126 /*     .. */
00127 /*     .. Local Arrays .. */
00128 /*     .. */
00129 /*     .. External Functions .. */
00130 /*     .. */
00131 /*     .. External Subroutines .. */
00132 /*     .. */
00133 /*     .. Scalars in Common .. */
00134 /*     .. */
00135 /*     .. Common blocks .. */
00136 /*     .. */
00137 /*     .. Data statements .. */
00138     /* Parameter adjustments */
00139     --nval;
00140     asav_dim1 = *lda;
00141     asav_offset = 1 + asav_dim1;
00142     asav -= asav_offset;
00143     a_dim1 = *lda;
00144     a_offset = 1 + a_dim1;
00145     a -= a_offset;
00146     --arf;
00147     --ap;
00148 
00149     /* Function Body */
00150 /*     .. */
00151 /*     .. Executable Statements .. */
00152 
00153 /*     Initialize constants and the random number seed. */
00154 
00155     nrun = 0;
00156     nerrs = 0;
00157     info = 0;
00158     for (i__ = 1; i__ <= 4; ++i__) {
00159         iseed[i__ - 1] = iseedy[i__ - 1];
00160 /* L10: */
00161     }
00162 
00163     i__1 = *nn;
00164     for (iin = 1; iin <= i__1; ++iin) {
00165 
00166         n = nval[iin];
00167 
00168 /*        Do first for UPLO = 'U', then for UPLO = 'L' */
00169 
00170         for (iuplo = 1; iuplo <= 2; ++iuplo) {
00171 
00172             *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00173             lower = TRUE_;
00174             if (iuplo == 1) {
00175                 lower = FALSE_;
00176             }
00177 
00178 /*           Do first for CFORM = 'N', then for CFORM = 'T' */
00179 
00180             for (iform = 1; iform <= 2; ++iform) {
00181 
00182                 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00183 
00184                 ++nrun;
00185 
00186                 i__2 = n;
00187                 for (j = 1; j <= i__2; ++j) {
00188                     i__3 = n;
00189                     for (i__ = 1; i__ <= i__3; ++i__) {
00190                         a[i__ + j * a_dim1] = dlarnd_(&c__2, iseed);
00191                     }
00192                 }
00193 
00194                 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)32, (ftnlen)6);
00195                 dtrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &info);
00196 
00197                 s_copy(srnamc_1.srnamt, "DTFTTP", (ftnlen)32, (ftnlen)6);
00198                 dtfttp_(cform, uplo, &n, &arf[1], &ap[1], &info);
00199 
00200                 s_copy(srnamc_1.srnamt, "DTPTTR", (ftnlen)32, (ftnlen)6);
00201                 dtpttr_(uplo, &n, &ap[1], &asav[asav_offset], lda, &info);
00202 
00203                 ok1 = TRUE_;
00204                 if (lower) {
00205                     i__2 = n;
00206                     for (j = 1; j <= i__2; ++j) {
00207                         i__3 = n;
00208                         for (i__ = j; i__ <= i__3; ++i__) {
00209                             if (a[i__ + j * a_dim1] != asav[i__ + j * 
00210                                     asav_dim1]) {
00211                                 ok1 = FALSE_;
00212                             }
00213                         }
00214                     }
00215                 } else {
00216                     i__2 = n;
00217                     for (j = 1; j <= i__2; ++j) {
00218                         i__3 = j;
00219                         for (i__ = 1; i__ <= i__3; ++i__) {
00220                             if (a[i__ + j * a_dim1] != asav[i__ + j * 
00221                                     asav_dim1]) {
00222                                 ok1 = FALSE_;
00223                             }
00224                         }
00225                     }
00226                 }
00227 
00228                 ++nrun;
00229 
00230                 s_copy(srnamc_1.srnamt, "DTRTTP", (ftnlen)32, (ftnlen)6);
00231                 dtrttp_(uplo, &n, &a[a_offset], lda, &ap[1], &info)
00232                         ;
00233 
00234                 s_copy(srnamc_1.srnamt, "DTPTTF", (ftnlen)32, (ftnlen)6);
00235                 dtpttf_(cform, uplo, &n, &ap[1], &arf[1], &info);
00236 
00237                 s_copy(srnamc_1.srnamt, "DTFTTR", (ftnlen)32, (ftnlen)6);
00238                 dtfttr_(cform, uplo, &n, &arf[1], &asav[asav_offset], lda, &
00239                         info);
00240 
00241                 ok2 = TRUE_;
00242                 if (lower) {
00243                     i__2 = n;
00244                     for (j = 1; j <= i__2; ++j) {
00245                         i__3 = n;
00246                         for (i__ = j; i__ <= i__3; ++i__) {
00247                             if (a[i__ + j * a_dim1] != asav[i__ + j * 
00248                                     asav_dim1]) {
00249                                 ok2 = FALSE_;
00250                             }
00251                         }
00252                     }
00253                 } else {
00254                     i__2 = n;
00255                     for (j = 1; j <= i__2; ++j) {
00256                         i__3 = j;
00257                         for (i__ = 1; i__ <= i__3; ++i__) {
00258                             if (a[i__ + j * a_dim1] != asav[i__ + j * 
00259                                     asav_dim1]) {
00260                                 ok2 = FALSE_;
00261                             }
00262                         }
00263                     }
00264                 }
00265 
00266                 if (! ok1 || ! ok2) {
00267                     if (nerrs == 0) {
00268                         io___19.ciunit = *nout;
00269                         s_wsle(&io___19);
00270                         e_wsle();
00271                         io___20.ciunit = *nout;
00272                         s_wsfe(&io___20);
00273                         e_wsfe();
00274                     }
00275                     io___21.ciunit = *nout;
00276                     s_wsfe(&io___21);
00277                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00278                     do_fio(&c__1, uplo, (ftnlen)1);
00279                     do_fio(&c__1, cform, (ftnlen)1);
00280                     e_wsfe();
00281                     ++nerrs;
00282                 }
00283 
00284 /* L100: */
00285             }
00286 /* L110: */
00287         }
00288 /* L120: */
00289     }
00290 
00291 /*     Print a summary of the results. */
00292 
00293     if (nerrs == 0) {
00294         io___22.ciunit = *nout;
00295         s_wsfe(&io___22);
00296         do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00297         e_wsfe();
00298     } else {
00299         io___23.ciunit = *nout;
00300         s_wsfe(&io___23);
00301         do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00302         do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00303         e_wsfe();
00304     }
00305 
00306 
00307     return 0;
00308 
00309 /*     End of DDRVRF2 */
00310 
00311 } /* ddrvrf2_ */


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