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


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