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


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