dckgsv.c
Go to the documentation of this file.
00001 /* dckgsv.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__8 = 8;
00019 static integer c__1 = 1;
00020 static integer c__0 = 0;
00021 
00022 /* Subroutine */ int dckgsv_(integer *nm, integer *mval, integer *pval, 
00023         integer *nval, integer *nmats, integer *iseed, doublereal *thresh, 
00024         integer *nmax, doublereal *a, doublereal *af, doublereal *b, 
00025         doublereal *bf, doublereal *u, doublereal *v, doublereal *q, 
00026         doublereal *alpha, doublereal *beta, doublereal *r__, integer *iwork, 
00027         doublereal *work, doublereal *rwork, integer *nin, integer *nout, 
00028         integer *info)
00029 {
00030     /* Format strings */
00031     static char fmt_9999[] = "(\002 DLATMS in DCKGSV   INFO = \002,i5)";
00032     static char fmt_9998[] = "(\002 M=\002,i4,\002 P=\002,i4,\002, N=\002,"
00033             "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00034 
00035     /* System generated locals */
00036     integer i__1, i__2;
00037 
00038     /* Builtin functions */
00039     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00040     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00041 
00042     /* Local variables */
00043     integer i__, m, n, p, im, nt, lda, ldb, kla, klb, kua, kub, ldq, ldr, ldu,
00044              ldv, imat;
00045     char path[3], type__[1];
00046     integer nrun, modea, modeb, nfail;
00047     char dista[1], distb[1];
00048     integer iinfo;
00049     doublereal anorm, bnorm;
00050     integer lwork;
00051     extern /* Subroutine */ int dlatb9_(char *, integer *, integer *, integer 
00052             *, integer *, char *, integer *, integer *, integer *, integer *, 
00053             doublereal *, doublereal *, integer *, integer *, doublereal *, 
00054             doublereal *, char *, char *), 
00055             alahdg_(integer *, char *);
00056     doublereal cndnma, cndnmb;
00057     extern /* Subroutine */ int alareq_(char *, integer *, logical *, integer 
00058             *, integer *, integer *), alasum_(char *, integer *, 
00059             integer *, integer *, integer *), dlatms_(integer *, 
00060             integer *, char *, integer *, char *, doublereal *, integer *, 
00061             doublereal *, doublereal *, integer *, integer *, char *, 
00062             doublereal *, integer *, doublereal *, integer *);
00063     logical dotype[8];
00064     extern /* Subroutine */ int dgsvts_(integer *, integer *, integer *, 
00065             doublereal *, doublereal *, integer *, doublereal *, doublereal *, 
00066              integer *, doublereal *, integer *, doublereal *, integer *, 
00067             doublereal *, integer *, doublereal *, doublereal *, doublereal *, 
00068              integer *, integer *, doublereal *, integer *, doublereal *, 
00069             doublereal *);
00070     logical firstt;
00071     doublereal result[7];
00072 
00073     /* Fortran I/O blocks */
00074     static cilist io___32 = { 0, 0, 0, fmt_9999, 0 };
00075     static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00076     static cilist io___37 = { 0, 0, 0, fmt_9998, 0 };
00077 
00078 
00079 
00080 /*  -- LAPACK test routine (version 3.1) -- */
00081 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00082 /*     November 2006 */
00083 
00084 /*     .. Scalar Arguments .. */
00085 /*     .. */
00086 /*     .. Array Arguments .. */
00087 /*     .. */
00088 
00089 /*  Purpose */
00090 /*  ======= */
00091 
00092 /*  DCKGSV tests DGGSVD: */
00093 /*         the GSVD for M-by-N matrix A and P-by-N matrix B. */
00094 
00095 /*  Arguments */
00096 /*  ========= */
00097 
00098 /*  NM      (input) INTEGER */
00099 /*          The number of values of M contained in the vector MVAL. */
00100 
00101 /*  MVAL    (input) INTEGER array, dimension (NM) */
00102 /*          The values of the matrix row dimension M. */
00103 
00104 /*  PVAL    (input) INTEGER array, dimension (NP) */
00105 /*          The values of the matrix row dimension P. */
00106 
00107 /*  NVAL    (input) INTEGER array, dimension (NN) */
00108 /*          The values of the matrix column dimension N. */
00109 
00110 /*  NMATS   (input) INTEGER */
00111 /*          The number of matrix types to be tested for each combination */
00112 /*          of matrix dimensions.  If NMATS >= NTYPES (the maximum */
00113 /*          number of matrix types), then all the different types are */
00114 /*          generated for testing.  If NMATS < NTYPES, another input line */
00115 /*          is read to get the numbers of the matrix types to be used. */
00116 
00117 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00118 /*          On entry, the seed of the random number generator.  The array */
00119 /*          elements should be between 0 and 4095, otherwise they will be */
00120 /*          reduced mod 4096, and ISEED(4) must be odd. */
00121 /*          On exit, the next seed in the random number sequence after */
00122 /*          all the test matrices have been generated. */
00123 
00124 /*  THRESH  (input) DOUBLE PRECISION */
00125 /*          The threshold value for the test ratios.  A result is */
00126 /*          included in the output file if RESULT >= THRESH.  To have */
00127 /*          every test ratio printed, use THRESH = 0. */
00128 
00129 /*  NMAX    (input) INTEGER */
00130 /*          The maximum value permitted for M or N, used in dimensioning */
00131 /*          the work arrays. */
00132 
00133 /*  A       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00134 
00135 /*  AF      (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00136 
00137 /*  B       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00138 
00139 /*  BF      (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00140 
00141 /*  U       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00142 
00143 /*  V       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00144 
00145 /*  Q       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00146 
00147 /*  ALPHA   (workspace) DOUBLE PRECISION array, dimension (NMAX) */
00148 
00149 /*  BETA    (workspace) DOUBLE PRECISION array, dimension (NMAX) */
00150 
00151 /*  R       (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00152 
00153 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00154 
00155 /*  WORK    (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00156 
00157 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (NMAX) */
00158 
00159 /*  NIN     (input) INTEGER */
00160 /*          The unit number for input. */
00161 
00162 /*  NOUT    (input) INTEGER */
00163 /*          The unit number for output. */
00164 
00165 /*  INFO    (output) INTEGER */
00166 /*          = 0 :  successful exit */
00167 /*          > 0 :  If DLATMS returns an error code, the absolute value */
00168 /*                 of it is returned. */
00169 
00170 /*  ===================================================================== */
00171 
00172 /*     .. Parameters .. */
00173 /*     .. */
00174 /*     .. Local Scalars .. */
00175 /*     .. */
00176 /*     .. Local Arrays .. */
00177 /*     .. */
00178 /*     .. External Subroutines .. */
00179 /*     .. */
00180 /*     .. Intrinsic Functions .. */
00181 /*     .. */
00182 /*     .. Executable Statements .. */
00183 
00184 /*     Initialize constants and the random number seed. */
00185 
00186     /* Parameter adjustments */
00187     --rwork;
00188     --work;
00189     --iwork;
00190     --r__;
00191     --beta;
00192     --alpha;
00193     --q;
00194     --v;
00195     --u;
00196     --bf;
00197     --b;
00198     --af;
00199     --a;
00200     --iseed;
00201     --nval;
00202     --pval;
00203     --mval;
00204 
00205     /* Function Body */
00206     s_copy(path, "GSV", (ftnlen)3, (ftnlen)3);
00207     *info = 0;
00208     nrun = 0;
00209     nfail = 0;
00210     firstt = TRUE_;
00211     alareq_(path, nmats, dotype, &c__8, nin, nout);
00212     lda = *nmax;
00213     ldb = *nmax;
00214     ldu = *nmax;
00215     ldv = *nmax;
00216     ldq = *nmax;
00217     ldr = *nmax;
00218     lwork = *nmax * *nmax;
00219 
00220 /*     Do for each value of M in MVAL. */
00221 
00222     i__1 = *nm;
00223     for (im = 1; im <= i__1; ++im) {
00224         m = mval[im];
00225         p = pval[im];
00226         n = nval[im];
00227 
00228         for (imat = 1; imat <= 8; ++imat) {
00229 
00230 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00231 
00232             if (! dotype[imat - 1]) {
00233                 goto L20;
00234             }
00235 
00236 /*           Set up parameters with DLATB9 and generate test */
00237 /*           matrices A and B with DLATMS. */
00238 
00239             dlatb9_(path, &imat, &m, &p, &n, type__, &kla, &kua, &klb, &kub, &
00240                     anorm, &bnorm, &modea, &modeb, &cndnma, &cndnmb, dista, 
00241                     distb);
00242 
00243 /*           Generate M by N matrix A */
00244 
00245             dlatms_(&m, &n, dista, &iseed[1], type__, &rwork[1], &modea, &
00246                     cndnma, &anorm, &kla, &kua, "No packing", &a[1], &lda, &
00247                     work[1], &iinfo);
00248             if (iinfo != 0) {
00249                 io___32.ciunit = *nout;
00250                 s_wsfe(&io___32);
00251                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00252                 e_wsfe();
00253                 *info = abs(iinfo);
00254                 goto L20;
00255             }
00256 
00257             dlatms_(&p, &n, distb, &iseed[1], type__, &rwork[1], &modeb, &
00258                     cndnmb, &bnorm, &klb, &kub, "No packing", &b[1], &ldb, &
00259                     work[1], &iinfo);
00260             if (iinfo != 0) {
00261                 io___33.ciunit = *nout;
00262                 s_wsfe(&io___33);
00263                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00264                 e_wsfe();
00265                 *info = abs(iinfo);
00266                 goto L20;
00267             }
00268 
00269             nt = 6;
00270 
00271             dgsvts_(&m, &p, &n, &a[1], &af[1], &lda, &b[1], &bf[1], &ldb, &u[
00272                     1], &ldu, &v[1], &ldv, &q[1], &ldq, &alpha[1], &beta[1], &
00273                     r__[1], &ldr, &iwork[1], &work[1], &lwork, &rwork[1], 
00274                     result);
00275 
00276 /*           Print information about the tests that did not */
00277 /*           pass the threshold. */
00278 
00279             i__2 = nt;
00280             for (i__ = 1; i__ <= i__2; ++i__) {
00281                 if (result[i__ - 1] >= *thresh) {
00282                     if (nfail == 0 && firstt) {
00283                         firstt = FALSE_;
00284                         alahdg_(nout, path);
00285                     }
00286                     io___37.ciunit = *nout;
00287                     s_wsfe(&io___37);
00288                     do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00289                     do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer));
00290                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00291                     do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00292                     do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
00293                     do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)sizeof(
00294                             doublereal));
00295                     e_wsfe();
00296                     ++nfail;
00297                 }
00298 /* L10: */
00299             }
00300             nrun += nt;
00301 L20:
00302             ;
00303         }
00304 /* L30: */
00305     }
00306 
00307 /*     Print a summary of the results. */
00308 
00309     alasum_(path, nout, &nfail, &nrun, &c__0);
00310 
00311     return 0;
00312 
00313 /*     End of DCKGSV */
00314 
00315 } /* dckgsv_ */


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